filament filters show more
hi, I have a large list of filters in a checkbox list using a table in a livewire component, the filters are currently showing in a modal, but is there a way to show only a few options on each large filter checkbox list and a view more button built into filament, like on Airbnb filters or would I have to make a custom blade view and pull it in? Thanks
...
https://imgur.com/a/u2suI5n
https://imgur.com/a/u2suI5n
Solution:
They can scroll through the select to see all options? It's just taking up less space and requires a click as does the "show more" option
Visual Inconsistencies in Filament Repeater with Dynamic Select Options
We are using a Filament form with a Repeater that contains a Select field to choose workers from the User model, filtered by the Employee role. The requirement is that once a worker is selected in one row, they should not appear in the Select options of other rows.
```php
Select::make('worker_id')->reactive()
->options(function (callable $get) {
$allUsers = User::role('Employee')->pluck('name', 'id');...
SubNavigation width ?
Hi , I'm trying find away to reduce the width of the side sub navigation
something like ,
->sidebarWidth('16rem')
but for sub navigation...
403 Forbidden in production
Hey !
I'm trying to deploy to production, site is working well but filament admin panel shows 403 forbidden after login
I've implemented the filament contract (returns true for testing purpose)
...
Solution:
Oh i'm actually not using the correct user model... Filament is using Admin model and not User. (might change that)
It works after updating the Admin model, stupid mistake!
Thank you !...
Creation of Table within Action's Tab
HI fellas, I have created Table Action that triggers slideOver(), and within that slideover i have 2 tabs. One is pure infolist and other I want it to be Company Data that would be Table within That "Company Data" tab. Is there any way to do it?
2 "save" actions on CreateResource with "mutateFormDataBeforeCreate"
Hi All,
I'm aware that actions can be added to a Resource. I would like to add an additional "Save" button on the CreateResource page. My goal is to mutate one parameter (e.g., $data['status'] = InternalStatus::CONCEPT) only when this new button is pressed.
Does anyone have any ideas on how to achieve this?...
Solution:
Here is the solution.
Create a Formfield, hide the label and add
hidden
as extraAttributes
```php...Custom Tab or custom tab view component
Is there way to make custom tab component without using blade component just with extend classes, i need to add just actions inside tab schema
Target [Illuminate\Database\Eloquent\Model] is not instantiable
I have the UserResource, which I guess, working all fine sometime before, however I find now I am not abe to create a new User (Target [Illuminate\Database\Eloquent\Model] is not instantiable.)
The EditUser works fine though
How to solve this? ...
Solution:
I think the issue is this part:
getLocationIdGroup(fn (Model $user): bool => $user->id == auth()->user()->id),
What does that method to? Where/when is the callback evaluated? You are probably not passing the user model...Issue with Default Items in Edit Mode for Questions Step
Hi everyone,
I'm encountering an issue with a form in FilamentPHP, specifically in the
questions
step. The form works perfectly in create mode but not in edit mode. Here’s a summary of the code and the problem I’m facing.
Code Overview:...Suggestion For Filament Dev
Hi guys, how do i make suggestion for dev's of Filament to add another hook, etc.. Where can i write suggestions to them 🙂 ?
Repeater and EditAction error
I have a list of items created from the Repeater Input and saved in DB as a json. When I used the edit action I get and error. ```
foreach() argument must be of type array|object, string given {"userId":1,"exception":"[object] (ErrorException(code: 0): foreach() argument must be of type array|object, string given at /var/www/html/vendor/filament/forms/src/Components/Repeater.php:783)
Below is how I try to
...
Solution:
Right, but a repeater, unless it is a relationship, needs to be cast on the model as either array or json.
persistStepInQueryString in CreateRecord
I'm using HasWizard and getSteps in a CreateRecord to make a resource form. Is there a way to add persistStepInQueryString()?
Use form builder and table builder on front-end
Hello,
I am trying to add Filament Form and Table in a Livewire component to use on front-end which but I need to import all the styles and scripts that the dashboard uses please as the form and table are not functioning properly if I am using external Tailwindcss styles.
Please let me know how can I make this work.
...
Solution:
make sure to follow these steps
https://filamentphp.com/docs/3.x/forms/installation#existing-laravel-projects...
How to Create an Organizational Chart in FilamentPHP?
Hi everyone,
I'm working on a project using FilamentPHP and I would like to add an organizational chart to display the structure of my company. I've tried using some libraries like OrgChart.js but I'm having trouble integrating it properly with Filament.
Could someone guide me on how to set up and display an organizational chart using FilamentPHP? Any tips on suitable libraries and how to integrate them, or code examples would be greatly appreciated....
Custom datetime filter within relation
I am building a table for an Alert model, whose timestamp is found through a 'timestamp' column from a related model (event), and I'm trying to get a filter on that, like this:
```php
Filter::make('event.timestamp')
->form([...
Solution:
Okey, I just solved it easily by using whereHas on QueryBuilder
```php
Filter::make('timestamp')
->form([
DateTimePicker::make('time_from')...
Notifications
Guys, have you ever had a problem with notifications?
I'm making an insertion in my customers table and I needed a notification to be displayed when registered.
Registration takes place through an end-point on a route that I created to receive an external request....
Placeholder color in TextColumn
I have the following:
`
Tables\Columns\TextColumn::make('receiver.name')
->label('To')...
Authorize an action
I'm using an action in a Livewire component. I'm trying to authorize the action, for example a user is allowed to delete a model.
I know I can hide or disable the action but that does not stop the 'selectedTableRecords' being changed or the 'mountTableAction' being tampered with.
What is the best way to check the user has authorization to perform the action given the action parameters?...
Solution:
There's also
->authorize()
Any way to toggle first in client-side?
Toggle column is absolutely awesome for what it does.
However, because it is not entangled, it does not have a good UX when working with slow internet.
How can I improve this please? (e.g. let the toggle happen client side while server roundtrip happen background)...