1. Go to this page and download the library: Download crumbls/filament-database 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/ */
crumbls / filament-database example snippets
use Crumbls\FilamentDatabase\FilamentDatabasePlugin;
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugins([
FilamentDatabasePlugin::make()
->authorize(function() {
// You need to customize this. It controls who can view it.
return false;
}),
]);
}
FilamentDatabasePlugin::make()
->authorize(fn () => auth()->user()->is_admin)
->readOnly() // block all writes
->preventDestructive() // block DROP / TRUNCATE
->connections(['mysql']) // limit to specific connections
->logQueries() // audit all SQL
->logChanges() // audit all data changes