Filament is a content management framework for rapidly building a beautiful administration interface designed for humans.
Visit the Filament documentation →
Need Help?
Filament is a content management framework for rapidly building a beautiful administration interface designed for humans.
Drag and drop ordering for repeater items:
https://user-images.githubusercontent.com/126740/160114202-a1a2a39b-44e6-438b-a466-0bf419be9c4c.mov
This PR adds a comprehensive API that allows grouping of Resource
and Page
elements in the Navigation.
The method to do so range from very simple single line of code additions, to an enhanced version of that with Mapped groups, or simply making a Page
or Resource
itself the top level group element.
Effectivly this feature provides this in two flavors:
Page
or Resource
that implements IsGroupItem
.Any resources that defines a $navigationGroup
property will be grouped by overlapping names.
This should be the menu label text for the group - with proper spaces and capitalization you'd like.
class BlogPostResource extends Resource
{
public static $navigationGroup = 'Content Group';
class ContentPage extends Page
{
public static $navigationGroup = 'Content Group';
So in this example there would be a new Content Group sub menu with both these in it.
The second method mimics how Laravel allows for Eloquent morphMap
to be used. In eloquent this maps long class names into uniform database values - for us it maps non-Page
and non-Resource
groups into a single location.
This method should be seen as an enhancement of the prior one. Since ultimately this is required to control the sort and icon settings for any Simple Groups. This would be something you could add in your AppServiceProvider::register
like this:
Filament::navigationGroupMap([
[
'name' => 'Content',
'sort' => -1,
'menus' => [
'default',
'foobar',
]
],
]);
Note: This could be something most useful for the Filament plugins. For instance when a plugin might want to register a group. In theory this should allow all plugins to use the navigationGroupMap without stepping on each others toes.
There are two very simple changes one would need to make a Resource into a Group. Simply adding the IsGroupItem
interface and the ImplicitGroupFromResource
trait. And that should be all they need to do. Like:
use Filament\Resources\Concerns\ImplicitGroupFromResource;
use Filament\View\Concerns\IsGroupItem;
class BlogPostResource extends Resource implements IsGroupItem
{
use ImplicitGroupFromResource;
And with just those added the Resource will now be a top-level Group item. Then to add another resource to this group do:
class BlogCategoryResource extends Resource
{
public static $navigationGroup = 'Blog Posts';
There are two very simple changes one would need to make a Resource into a Group. Simply adding the IsGroupItem
interface and the ImplicitGroupFromResource
trait. And that should be all they need to do. Like:
use Filament\Pages\Concerns\ImplicitGroupFromPage;
use Filament\View\Concerns\IsGroupItem;
class ContentPage extends Page implements IsGroupItem
{
use ImplicitGroupFromPage;
And with just those added the Resource will now be a top-level Group item. Then to add another resource to this group do:
class BlogTagResource extends Resource
{
public static $navigationGroup = 'Content Page';
Closed/Open | Open/Closed
:----------:|:-------:
|
Item within SubMenu Selected
SubMenu # 1: Blog Posts | SubMenu # 2: Content page
:----------:|:-------:
|
Describe the bug
I have a BelongsToSelect form relation in my post model. Components\BelongsToSelect::make('user_id')->relationship('user', 'username')->required(),
I can search any user who have the username all lowercase. But for those Uppercase one this never match, even if I search with the Uppercase letter.
To reproduce Having uppercase username in a table with a BelongsToSelect relation.
Expected behavior I expected to see any user matching the search term.
Screenshots
Context
Additional details
As you can see, when I type e
I get EQuimper there. But the reason is because of the er
at the end. This never match the big E
This PR replacing #1935 for fixing issue #1899
This is a first rough stab at adding column selection to tables. This is what it looks like:
To make a column selectable, add ->selectable()
when defining a column. If any columns in a table are selectable, the action icon appears on the table.
I very closely followed the way filters are implemented, copied and pasted quite a bit of that code.
I'm looking for input on a number of items:
ColumnSelection
and CanBeSelectable
and isColumnSelectionVisible
and I'm really not sure these are well named. Is there a better single-word term for this "column selectability" behavior anyone can think of?->selectable()
it is hidden by default until you select it. Need a way to also indicate that it should default to visible, thoughts on a good method name for that?tables::table.buttons.filter.label
which obviously will need to change.Feedback welcome. =)
This PR makes some minor tweaks to the compact file upload layout, so that it fits nicely with the other fields and is actually a bit more compact. Changes are:
min-height
on the drop area element has been tweaked so it that it's the same height as the uploading/file element, removing the dead space below the field when a value is setThis PR also adds a disablePreview()
method, to switch off the image preview feature.
These changes allow for a very compact and consistently sized single file upload field that fits alongside other fields.
Before:
After:
Blank values:
Also includes filepond-plugin-media-preview feature from https://github.com/laravel-filament/filament/pull/1643
I added new missing Spanish translations.
filament/filament
v2.12.10
v9.12.2
No response
PHP 8.1
I have multiple (BelongsToManyMultiSelect) fields and each field is visible based on the state of another reactive radio field.
When changing the state of radio field to switch between BelongsToManyMultiSelect fields, attributes of BelongsToManyMultiSelect not updated. only label attribute is updated.
Here are my form fields.
Radio::make('applies_to')
->label(__('admin.Applies To'))
->reactive()
->afterStateUpdated(function ($set) {
foreach (Coupon::APPLIES_TO as $appliesTo) {
$set(str($appliesTo)->snake(), null);
}
})
->options(
collect(Coupon::APPLIES_TO)->mapWithKeys(function ($appliesTo) {
return [ $appliesTo => __('admin.' . $appliesTo) ];
})->toArray()
)
->dehydrated(false)
->default(Coupon::APPLIES_TO_ALL)
->saveRelationshipsUsing(function ($state, Model|Coupon $record) {
if ($state && $state == Coupon::APPLIES_TO_ALL) {
$record->clearOtherRelations();
}
$record->applies_to = $state;
$record->save();
}),
BelongsToManyMultiSelect::make('products')
->label(__('admin.Products'))
->required()
->relationship('products', 'name')
->visible(fn($get) => $get('applies_to') == Coupon::APPLIES_TO_PRODUCTS),
BelongsToManyMultiSelect::make('categories')
->label(__('admin.Categories'))
->required()
->relationship('categories', 'name')
->visible(fn($get) => $get('applies_to') == Coupon::APPLIES_TO_CATEGORIES),
No response
filament/forms
2.12.10
9.12.2
2.10.5
8.1.5
Thanks for fixing the issue where the collapsed section didn't expand when there is validation error when press submit
https://github.com/laravel-filament/filament/issues/2231
Now the collapsed section did expand upon validation error, however it didn't scroll up to the 1st place/field with the error, leading to users confused as they press the submit button at the bottom of the form but nothing happen. Some of them are tech savvy enough to realise and scroll all the way up, but some also don't and end up close the browser tab in our internal usability testing.
If this can be fixed, it will be great!
No response
No response
filament/forms
v2.12.8
v9.12.2
v2.10.5
8.1.5
DatePicker window does not jump to first available date when using the minDate() function
Create two DatePicker fields, set the first reactive and the second to minDate(fn(callable $get) => $get('first_date')). Assign a date a few months in the future in the first field, then open the second field. The dates will be greyed out, but the will still remain on the current month, rather than jumping to the month with the first available selectable date.
No response
filament/forms
v2.12
v9.11
No response
PHP 8.1.2
Uploading a File doesn't save the path to the database, if there is already a path to file that doesn't exist in the database.
NULL
is working.No response
Full Changelog: https://github.com/laravel-filament/filament/compare/v2.12.9...v2.12.10
getRecordTitle()
for relation manager by @pxlrbt in https://github.com/laravel-filament/filament/pull/2409Full Changelog: https://github.com/laravel-filament/filament/compare/v2.12.8...v2.12.9
Full Changelog: https://github.com/laravel-filament/filament/compare/v2.12.7...v2.12.8
Full Changelog: https://github.com/laravel-filament/filament/compare/v2.12.4...v2.12.5
Full Changelog: https://github.com/laravel-filament/filament/compare/v2.12.3...v2.12.4
Full Changelog: https://github.com/laravel-filament/filament/compare/v2.12.2...v2.12.3