https://github.com/stephenjude/filament-debugger
Easily add Laravel Telescope and Horizon to Filament admin panel.
https://github.com/stephenjude/filament-debugger
filament laravel
Last synced: 28 days ago
JSON representation
Easily add Laravel Telescope and Horizon to Filament admin panel.
- Host: GitHub
- URL: https://github.com/stephenjude/filament-debugger
- Owner: stephenjude
- License: mit
- Created: 2022-08-11T08:54:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-25T08:03:45.000Z (about 1 year ago)
- Last Synced: 2024-04-13T21:11:57.210Z (about 1 year ago)
- Topics: filament, laravel
- Language: PHP
- Homepage:
- Size: 147 KB
- Stars: 55
- Watchers: 4
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-filament - stephenjude/filament-debugger - Easily add Laravel Telescope and Horizon to Filament. (Complete Sections)
README

# Filament Debugger
[](https://packagist.org/packages/stephenjude/filament-debugger)
[](https://github.com/stephenjude/filament-debugger/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/stephenjude/filament-debugger/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[](https://packagist.org/packages/stephenjude/filament-debugger)Easily add Telescope, Horizon and Laravel Pulse to Filament admin panel.

## Installation
You can install the package via composer:
```bash
composer require stephenjude/filament-debugger
```## Usages
```php
use Stephenjude\FilamentDebugger\DebuggerPlugin;public function panel(Panel $panel): Panel
{return $panel
->plugin(
DebuggerPlugin::make()
);
}
```### Custom Role/Permission
You can authorize the plugin for users with a specific role/permission:```php
DebuggerPlugin::make()
->authorize(condition: fn() => auth()->user()->can('view.debuggers'));
```### Custom Navigation Group
You can customize the navigation group:```php
use Stephenjude\FilamentDebugger\DebuggerPlugin;$panel->plugin(
DebuggerPlugin::make()
->navigationGroup(condition: true, label: 'Debugger')
);
```### Custom Navigation Items
You can customize the navigation items:```php
use Stephenjude\FilamentDebugger\DebuggerPlugin;$panel->plugin(
DebuggerPlugin::make()
->horizonNavigation(
condition: fn () => auth()->user()->can('view.horizon'),
label: 'Horizon',
icon: 'heroicon-o-globe-europe-africaglobe-europe-africa',
url: url('horizon'),
openInNewTab: fn () => true
)
->telescopeNavigation(
condition: fn()=> auth()->user()->can('view.telescope'),
label: 'Telescope',
icon: 'heroicon-o-sparkles',
url: url('telescope'),
openInNewTab: fn () => true
)
->pulseNavigation(
condition: fn () => auth()->user()->can('view.pulse'),
label: 'Pulse',
icon: 'heroicon-o-bolt',
url: url('pulse'),
openInNewTab: fn () => true
)
);
```## Gates & Authorization
When using filament debuggers (Horizon, Telescope & Pulse) in **production environment**, we need to make sure that they are accessible to the authorized filament admin user.To achive this, we need to use filament default authorization guard and your application defined permissions provided by overidding the `gate()` and `authorization()` methods inside the HorizonServiceProvider, TelescopeServiceProvider and PulseServiceProvider respectively.
```php
protected function gate()
{
Gate::define('viewHorizon', function ($user) {
return $user->can('view.debuggers');
});
}protected function authorization()
{
Auth::setDefaultDriver(config('filament.auth.guard'));parent::authorization();
}```
## Testing
```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](https://github.com/stephenjude/.github/blob/main/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [stephenjude](https://github.com/stephenjude)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.