geo-sot / filament-env-editor
Access .env file though Filament admin panel
Fund package maintenance!
GeoSot
Requires
- php: >=8.1
- filament/filament: ^3.0
- geo-sot/laravel-env-editor: ^3.0
- illuminate/contracts: ^10.0|^11.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
README
A Simple .env file Viewer plugin for your Filament Panels.
Provides features like, manage current .env variables, and a handy backup functionality page
Installation
You can install the package via composer:
composer require geo-sot/filament-env-editor
Usage
Add the GeoSot\FilamentEnvEditor\FilamentLEnvEditorPlugin
to your panel config.
use GeoSot\FilamentEnvEditor\FilamentEnvEditorPlugin; class AdminPanelProvider extends PanelProvider { public function panel(Panel $panel): Panel { return $panel // ... ->plugin( FilamentEnvEditorPlugin::make() ); } }
Configuration
Customizing the navigation item
FilamentLEnvEditorPlugin::make() ->navigationGroup('System Tools') ->navigationLabel('My Env') ->navigationIcon('heroicon-o-cog-8-tooth') ->navigationSort(1) ->slug('env-editor')
Authorization
If you would like to prevent certain users from accessing the logs page, you should add a authorize
callback in the FilamentLEnvEditorPlugin chain.
FilamentLEnvEditorPlugin::make() ->authorize( fn () => auth()->user()->isAdmin() )
Customizing the log page
To customize the "env-editor" page, you can extend the GeoSot\FilamentEnvEditor\Pages\ViewEnv
page and override its methods.
use GeoSot\FilamentEnvEditor\Pages\ViewEnv as BaseViewEnvEditor; class ViewEnv extends BaseViewEnvEditor { // Your implementation }
use App\Filament\Pages\ViewEnv; FilamentLEnvEditorPlugin::make() ->viewLog(ViewEnv::class)
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.