1. Go to this page and download the library: Download dbflowlabs/filament 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/ */
use DbflowLabs\Core\Actions\SyncWorkflowDefinitions;
app(SyncWorkflowDefinitions::class)->handle();
use DbflowLabs\Core\DBFlow;
use DbflowLabs\Core\Services\AssigneeResolverRegistry;
DBFlow::registerAssigneeResolver(
app(AssigneeResolverRegistry::class),
'finance_team',
$myAssigneeResolver,
);
declare(strict_types=1);
namespace App\Providers\Filament;
use DbflowLabs\Filament\Support\DBFlowFilamentPanel;
use Filament\Panel;
use Filament\PanelProvider;
final class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
$panel = $panel
->id('admin')
->path('admin') // or '' when the panel is mounted at the site root
// your pages, resources, middleware, branding...
;
if ($this->shouldRegisterDbflow()) {
return DBFlowFilamentPanel::register($panel);
}
return $panel;
}
private function shouldRegisterDbflow(): bool
{
if (! (bool) config('dbflow-filament.enabled', true)) {
return false;
}
// Optional host product flag — replace with your application's config key.
return (bool) config('myapp.workflow.filament_enabled', true);
// Some hosts also gate Core runtime separately via config('dbflow.enabled').
// DBFlowFilamentPanel does not read dbflow.enabled; that flag affects action buttons at runtime.
}
}
use DbflowLabs\Filament\Support\DBFlowFilamentPanel;
$panel->pages([
...$panel->getPages(),
...DBFlowFilamentPanel::pageClasses(),
]);
$panel->resources([
...$panel->getResources(),
...DBFlowFilamentPanel::resourceClasses(),
]);