https://github.com/geosot/filament-env-editor
https://github.com/geosot/filament-env-editor
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/geosot/filament-env-editor
- Owner: GeoSot
- License: mit
- Created: 2024-04-12T00:25:03.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-17T07:23:03.000Z (about 2 years ago)
- Last Synced: 2024-05-01T14:31:42.108Z (about 2 years ago)
- Language: PHP
- Size: 17.6 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Filament Env Editor
[](https://packagist.org/packages/geo-sot/filament-env-editor)
[](https://packagist.org/packages/geo-sot/filament-env-editor)
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:
```bash
composer require geo-sot/filament-env-editor
```
## Usage
Add the `GeoSot\FilamentEnvEditor\FilamentEnvEditorPlugin` to your panel config.
```php
use GeoSot\FilamentEnvEditor\FilamentEnvEditorPlugin;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(
FilamentEnvEditorPlugin::make()
);
}
}
```
## Configuration
### Customizing the navigation item
```php
FilamentEnvEditorPlugin::make()
->navigationGroup('System Tools')
->navigationLabel('My Env')
->navigationIcon('heroicon-o-cog-8-tooth')
->navigationSort(1)
->slug('env-editor')
```
### Hiding keys
Some keys you may consider to be particularly sensitive and don't wish to expose them, even through this package. You can hide them through this interface:
```php
FilamentEnvEditorPlugin::make()
->hideKeys('APP_KEY', 'BCRYPT_ROUNDS')
```
### Authorization
If you would like to prevent certain users from accessing the logs page, you should add a `authorize` callback in the FilamentLEnvEditorPlugin chain.
```php
FilamentEnvEditorPlugin::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.
```php
use GeoSot\FilamentEnvEditor\Pages\ViewEnv as BaseViewEnvEditor;
class ViewEnv extends BaseViewEnvEditor
{
// Your implementation
}
```
```php
use App\Filament\Pages\ViewEnv;
FilamentEnvEditorPlugin::make()
->viewPage(CustomEnvPage::class)
```
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.