Skip to content

Commit 75a2418

Browse files
committed
wip
1 parent ce39a25 commit 75a2418

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class Role extends Model
175175
By default, Sushi looks at the "last modified" timestamp of your model PHP file and compares it with its internal `.sqlite` cache file. If the model file has been changed more recently than the `.sqlite` cache file, then Sushi will destroy and rebuild the `.sqlite` cache.
176176
Additionally, you can configure an external file for Sushi to reference when determining if the cache is up to date or needs to be refreshed.
177177

178-
If, for example, you are using Sushi to provide an Eloquent model for an external data source file like an `.csv` file, you can use `sushiModelPath` to force Sushi to reference the `.csv` file when determining if the cache is stale.
178+
If, for example, you are using Sushi to provide an Eloquent model for an external data source file like an `.csv` file, you can use `sushiCacheReferencePath` to force Sushi to reference the `.csv` file when determining if the cache is stale.
179179

180180
For example:
181181

@@ -194,7 +194,7 @@ class Role extends Model
194194
return true;
195195
}
196196

197-
protected function sushiModelPath()
197+
protected function sushiCacheReferencePath()
198198
{
199199
return __DIR__.'/roles.csv';
200200
}

src/Sushi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function getSchema()
2121
return $this->schema ?? [];
2222
}
2323

24-
protected function sushiModelPath()
24+
protected function sushiCacheReferencePath()
2525
{
2626
return (new \ReflectionClass(static::class))->getFileName();
2727
}
@@ -43,7 +43,7 @@ public static function bootSushi()
4343
$cacheFileName = config('sushi.cache-prefix', 'sushi').'-'.Str::kebab(str_replace('\\', '', static::class)).'.sqlite';
4444
$cacheDirectory = realpath(config('sushi.cache-path', storage_path('framework/cache')));
4545
$cachePath = $cacheDirectory.'/'.$cacheFileName;
46-
$dataPath = $instance->sushiModelPath();
46+
$dataPath = $instance->sushiCacheReferencePath();
4747

4848
$states = [
4949
'cache-file-found-and-up-to-date' => function () use ($cachePath) {

0 commit comments

Comments
 (0)