If you see anything missing from this guide, please do not hesitate to make a pull request to our repository! Any help is appreciated!
High impact changes
Property and method changes to resource and page classes
Forms
The entireFilament\Resources\Forms namespace has been moved to Filament\Forms.
The when(), only() and except() methods have been removed. You may now pass a closure to any field configuration method, for example hidden(), which determines if the method should be applied. For more information, please see the advanced forms documentation;
Fields
Thedependable() method has been renamed to reactive(), to better describe its effects.
The helpMessage() method has been renamed to helperText().
Checkbox
Thestacked() method has been removed, and replaced with inline(false).
Select
TheemptyOptionsMessage() method has been renamed to searchPrompt().
Tags input
The tags input component now writes to a JSON array by default. To continue using the old behavior, useseparator(',') method.
Toggle
Thestacked() method has been removed, and replaced with inline(false).
Layout components
Fieldset
The form components within the fieldset now need to be in their ownschema() method, instead of being passed into make().
Grid
The form components within the grid now need to be in their ownschema() method, instead of being passed into make().
Section
The form components within the section now need to be in their ownschema() method, instead of being passed into make().
Tabs
TheFilament\Resources\Forms\Tab component has been moved to Filament\Forms\Tabs\Tab.
The form components within each tab now need to be in their own schema() method, instead of being passed into make().
Tables
The entireFilament\Resources\Tables namespace has been moved to Filament\Tables.
The only() and except() methods have been removed. You may now pass a closure to any column or filter configuration method, which determines if the method should be applied.
Columns
Column class names now haveColumn at the end, for example TextColumn not Text.
The currency() method has been renamed to money().
The formatUsing() method has been renamed to formatStateUsing(). It now accepts a $state parameter, instead of $value.
The getValueUsing() method has been renamed to getStateUsing().
The primary() method has been removed from columns. All columns link to the record page by default unless another URL or action is specified for that column.
Filters
The filter class has been moved fromFilament\Resources\Tables\Filter to Filament\Tables\Filters\Filter.
Filters now have a dedicated query() method for applying the query, instead of using the second parameter of the make() method. For more information, check out the table builder filters documentation.
The apply() method of reusable filters must now have the following signature:
Published configuration updates
If you’ve published the v1.xfilament.php configuration file, you should republish it:
path, domain or default_filesystem_disk, you should update the new file with these changes. If you’re using .env variables for these settings, you won’t need to make any changes when upgrading, and you may even choose to delete filament.php.
Users
Filament v2.x does not include a dedicatedfilament_users table as it did in v1.x. By default, all App\Models\Users can access the admin panel locally, and in production you must apply the FilamentUser interface to the model to control admin access. You can read more about this here.
Medium impact changes
Relation managers
HasMany relation manager classes should now extend Filament\Resources\RelationManagers\HasManyRelationManager. MorphMany relation manager classes should now extend Filament\Resources\RelationManagers\MorphManyRelationManager. BelongsToMany relation manager classes should now extend Filament\Resources\RelationManagers\BelongsToManyRelationManager.
The Filament\Resources\Forms\Form class has been renamed to Filament\Resources\Form.
The Filament\Resources\Tables\Table class has been renamed to Filament\Resources\Table.
The following properties and method signatures been updated:
Filament\Filament facade renamed to Filament\Facades\Filament
You should be able to safely rename all instances of this class to the new one.
Roles
Filament now only uses policies for authorization, so you may implement whichever roles system you wish there. We recommendspatie/laravel-permission.
You may remove any roles from the App\Filament\Roles directory, and delete any authorization() methods on your resources.