PHP code example of stephenjude / filament-debugger
1. Go to this page and download the library: Download stephenjude/filament-debugger library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
stephenjude / filament-debugger example snippets
return [
'debuggers' => [
'horizon',
'telescope'
],
'authorization' => false,
'permissions' => [
'horizon' => 'horizon.view',
'telescope' => 'telescope.view',
],
];
$panel
->plugins([
DebuggerPlugin::make(),
]);
protected function gate()
{
Gate::define('viewHorizon', function ($user) {
return $user->can(config('filament-debugger.permissions.horizon'));
});
}
protected function authorization()
{
Auth::setDefaultDriver(config('filament.auth.guard'));
parent::authorization();
}
protected function gate()
{
Gate::define('viewTelescope', function ($user) {
return $user->can(config('filament-debugger.permissions.telescope'));
});
}
protected function authorization()
{
Auth::setDefaultDriver(config('filament.auth.guard'));
parent::authorization();
}
use Spatie\Permission\Models\Permission;
collect(config('filament-debugger.permissions'))
->map(fn($permission) => Permission::firstOrCreate([
'name' => $permission,
'guard_name' => config('filament.auth.guard'),
]));
'permissions' => [
'horizon' => 'your horizon permission name',
'telescope' => 'your telescope permission name',
],
bash
php artisan filament-debugger:install