-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Laravel Octane support #58
Comments
The possible problem is that this method always has the same $token value: laravel-telescope-toolbar/src/Toolbar.php Line 201 in baa455f
|
I have found an "issue" which is Laravel Octane related, but not similar to the original issue. If somone using start kit and installs the Octane and Toolbar as well, but not running view:clear, before starting Octane the first time, will found it self, that the icons are not loaded, just the @TTicon directive is shown. The main "issue" is that Octane automatically caches the views. (It does not make a difference, if you use the file watching option on Octane.) While running the Octane you cannot clear the view cache, so you have to stop the server first and clear the view cache after. If you clear the cache and start again the Octane server, the icons will appear now. I'm not 100% sure, if the Toolbar should handle the view cache clearing when Octane is used, but I just thought maybe it'll help someone else if experiencing this icon problem. |
@bornemisza Thank you for your solution, but unfortunately it didn't help me. Here's my solution that I hope will help others who have encountered the same issue:
<?php
declare(strict_types=1);
namespace App\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class TelescopeToolbarServiceProvider extends ServiceProvider
{
public function register(): void
{
//
}
public function boot(): void
{
Blade::directive('ttIcon', static function ($expression) {
$dir = \realpath(__DIR__ . '/../../vendor/fruitcake/laravel-telescope-toolbar/resources/icons');
return "<?php echo file_get_contents('$dir/' . basename($expression) . '.svg'); ?>";
});
}
}
<?php
return [
App\Providers\AppServiceProvider::class,
App\Providers\TelescopeServiceProvider::class,
App\Providers\TelescopeToolbarServiceProvider::class,
]; P.S. I've only tested this on Laravel 11 |
Tried to register it in the
flush
section, still shows first request all the time.The text was updated successfully, but these errors were encountered: