jeffersongoncalves/filament-flux-pro
Filament v5 plugin that wraps Livewire Flux Pro components as native Filament form fields, widgets, schema components, table columns, and page concerns (date pickers, editor, uploads, charts, tabs, kanban, command palette, etc.). Requires Flux Pro license.
Install Dependencies:
composer require jeffersongoncalves/filament-flux-pro
Ensure jeffersongoncalves/filament-flux is installed and registered first.
Configure Authentication:
Add Flux Pro credentials to auth.json (never commit this file) and update composer.json with the Flux Pro repository.
Run Installation Command:
php artisan filament-flux-pro:install --panel=admin
This patches Tailwind config, publishes the config file, and warns about missing prerequisites.
Activate Flux:
php artisan flux:activate
npm run build
php artisan view:clear
Register Plugin:
In your Panel provider:
->plugin(FilamentFluxProPlugin::make()->useEverywhere())
Replace a basic DatePicker with FluxDatePicker in a Resource:
use Jeffersongoncalves\FilamentFluxPro\Forms\Components\FluxDatePicker;
FluxDatePicker::make('published_at')
->fluxMode('single')
->required();
Rebinding Existing Fields:
Enable useEverywhere() to automatically replace Filament’s native fields (e.g., DatePicker → FluxDatePicker). Disable specific fields if needed:
->plugin(FilamentFluxProPlugin::make()->useEverywhere([
'fileUpload' => false,
]))
Dynamic Data Binding:
Use closures for dynamic options (e.g., FluxAutocomplete):
FluxAutocomplete::make('user_id')
->fluxOptionsResolver(fn ($search) => User::where('name', 'like', "%{$search}%")->pluck('name', 'id')->toArray());
Subclassing Abstract Widgets:
Extend FluxLineChartWidget to create custom charts:
class RevenueChart extends FluxLineChartWidget {
protected function getData(): array {
return Revenue::query()->get()->map(fn ($r) => ['date' => $r->created_at, 'value' => $r->amount])->toArray();
}
}
Table Integration:
Use FluxChartColumn for sparklines in tables:
FluxChartColumn::make('sales_trend')
->fluxData(fn ($record) => $record->last7DaysSales())
->fluxColor(fn ($record) => $record->trend > 0 ? 'green' : 'red');
Nested Components:
Combine FluxTabs with Flux Pro fields:
FluxTabs::make('Post')
->tabs([
Tab::make('Content')->schema([
FluxEditor::make('body'),
]),
]);
Conditional Rendering:
Use FluxPopover for tooltips or modals:
{{ FluxPopover::trigger(
triggerHtml: '<flux:button>Help</flux:button>',
contentHtml: '<flux:text>Detailed instructions...</flux:text>',
) }}
Kanban Board:
Extend FluxKanbanPage for drag-and-drop task management:
class TasksKanban extends FluxKanbanPage {
protected function getKanbanColumns(): array {
return [
KanbanColumnDefinition::make('Backlog'),
KanbanColumnDefinition::make('In Progress'),
];
}
}
Command Palette: Enable globally in the plugin:
->plugin(FilamentFluxProPlugin::make()->enableCommandPalette())
Missing auth.json:
RuntimeException during installation if Flux Pro credentials are missing.auth.json to the project root and ensure it’s in .gitignore.Forgetting filament-flux:
RuntimeException if jeffersongoncalves/filament-flux isn’t registered.FilamentFluxPlugin before FilamentFluxProPlugin.Tailwind Scanning Issues:
npm run build and php artisan view:clear to ensure Flux Pro’s Tailwind classes are processed.Flux Pro License:
livewire/flux-pro is proprietary. Ensure your license is valid.Console Errors:
Check browser console for Flux Pro-specific errors (e.g., missing dependencies). Run npm run dev to rebuild assets.
Field State:
Flux Pro fields dehydrate data differently (e.g., FluxComposer returns ['text' => ..., 'attachments' => ...]). Cast model attributes accordingly:
protected $casts = [
'message' => 'array',
];
Custom CSS:
Flux Pro uses Tailwind v4. Override styles in resources/css/filament/panel/theme.css:
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer components {
@import 'flux-pro';
}
Custom Flux Options:
Override getOptions() in chart widgets or use fluxConfig() on fields:
FluxLineChartWidget::make()
->fluxConfig(['colors' => ['blue', 'green']]);
Dynamic Column Definitions:
Fetch KanbanColumnDefinition data dynamically:
getKanbanColumns(): array {
return Status::all()->map(fn ($status) =>
KanbanColumnDefinition::make($status->name)
->color($status->color)
);
}
Sanitization:
Use HtmlSanitizer for FluxEditor content:
FluxEditor::make('content')->fluxSanitize();
Customize allowed tags in config/filament-flux-pro.php:
'editor' => [
'allowed_tags' => ['<strong>', '<em>', '<a>'],
],
File Uploads:
Configure FluxFileUpload with Laravel storage disks:
FluxFileUpload::make('avatar')
->fluxDisk('s3')
->fluxDirectory('avatars')
->fluxVisibility('public');
Lazy-Loading:
For large datasets in FluxAutocomplete, implement server-side search with pagination:
->fluxOptionsResolver(fn ($search) => User::where('name', 'like', "%{$search}%")->paginate(10)->pluck('name', 'id'));
Chart Optimization:
Limit data points in FluxChartColumn:
->fluxData(fn ($record) => $record->last30DaysSales()->take(10));
How can I help you explore Laravel packages today?