Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
markvaneijk authored Jun 6, 2024
1 parent 88e2764 commit 668fa2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/PermanentCacheServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function configurePackage(Package $package): void
PermanentCachesStatusCommand::class,
UpdatePermanentCachesCommand::class
)
->hasRoute('api')
->hasConfigFile();
}

Expand All @@ -27,8 +28,6 @@ public function registeringPackage()

public function bootingPackage()
{
$this->loadRoutesFrom(__DIR__ . '/Routes/web.php');

$this->callAfterResolving(
Schedule::class,
fn (Schedule $schedule) => collect(Facades\PermanentCache::configuredCaches())
Expand Down
7 changes: 3 additions & 4 deletions src/Routes/web.php → src/routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

use Illuminate\Support\Facades\Route;

Route::get('/permanent-cache/update/', function () {
Route::get('permanent-cache/update/', function () {
$vars = decrypt(array_key_first(request()->all()));
extract($vars);
[$class] = $vars;

$class = new \ReflectionClass($class);
$staticClass = $class->getName();

$staticClass::update();

return \Illuminate\Support\Facades\Blade::renderComponent(app()->make($class, $props));
return $staticClass::updateAndGet($parameters);
})->name('permanent-cache.update');

0 comments on commit 668fa2f

Please sign in to comment.