Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
arduinomaster22 committed Jun 3, 2024
1 parent 9468664 commit e968ee2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/CachesValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,13 @@ public function addMarkers($value): mixed

public function getRefreshRoute()
{
$class = (new ReflectionClass($this))->name;;
return route('permanent-cache.update', encrypt([$class]));
$class = get_class($this);
$props =
collect((new ReflectionClass($this))->getProperties(\ReflectionProperty::IS_PUBLIC))
->where('class', __CLASS__)
->mapWithKeys(fn ($prop) => [$prop->name => $this->{$prop->name}])
->toArray();

return route('permanent-cache.update', ['data' => encrypt([$class, $props])]);
}
}
4 changes: 3 additions & 1 deletion src/Routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
$class = new \ReflectionClass($class);
$staticClass = $class->getName();

return response($staticClass::updateAndGet(), 200, []);
$staticClass::update();

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

0 comments on commit e968ee2

Please sign in to comment.