Filament

F

Filament

Filament is a collection of beautiful full-stack components for Laravel.You can get help using it on our Discord.

Join

State context in infolist

Is it currently possible to get the context of the info list repeater in the action? Can I only do this with models?
No description

Change the size of the Stats Overview Widget

Hello, I would like some help to reduce the size of my stat widget, I want to reduce the size by half, I am rendering this widget on a custom page, I need the widgets to be shown in a single column, apparently by default the page is divided into 3 columns, could someone help me please? Card::make( $nms->name,...
No description

approval system workflow

i can do with filament the following app with this requirements? Multi-Level Authorization: The system should have distinct roles, allowing different levels of access and permissions. Request Submission: Store managers can request up to 10 personnel for their store, using an editable table and specifying a weekly plan with start and end dates....

Create & Add another button is closing the relation manager modal

In every relation manager I've tested the Create & add another button also animates the create button and then the modal closes instead of remaining open after saving the record. Seems suspiciously similar to bug 10094 https://github.com/filamentphp/filament/issues/10094 Anyone else experiencing this? Is there a workaround?...

Grouping Rows with Closure/Tree relation

So i have a table in this shape: `Schema::create('products', function (Blueprint $table) { $table->increments('id'); $table->string('name');...
No description

use `configureUsing` to avoid repetition

I have many password fields in my application so i'd like to use ```php class AdminPanelProvider extends PanelProvider { public function boot()...

Can I use a filament table outside of Filament directories?

I love Filament so much that I want to use its Table feature in another part of my code. This code has nothing to do with Filament. Because this is not a Filament Resource, I don't know how to invoke a Table and feed it headers, columns, etc, as I would in a traditional Resource. Is this possible to do, or must Tables, with their magical properties, live in a typical Resource PHP file under the Filament directory structure?...

Prepopulate constraints

When using constraints in a table filter like here: https://filamentphp.com/docs/3.x/tables/filters/query-builder is it possible to pre-populate the filters? I looked at doing it via query string, but because the constraints are dynamic it doesn't look like it'll work I have a table full of data and I'd like to "guess" which record the user wants to see by some filtering across multiple fields. I'm avoiding modifying the query of the table so that users have access to all the records. ...

Change repeater field label based on other field value

I have a wizard form and there's a repeater on step 4. I'd like to change the label of one of the fields inside the repeater based on the value of a field on step 1. It works fine if it's outside the repeater but the $get('fieldname') comes back NULL if it's inside. Is there a way to pass that field value into the repeater somehow so it can be accessed and passed into the label() closure? I can provide code snippets if necessary....
Solution:
If anyone else needs something like this, I was able to pass in the $livewire object instead of $get. Then you can evaluate $livewire->data['fieldname'] within the closure.

Actions in table column view not triggering

Hi, TLDR; Action in table ViewColumn doesn't do anything when clicked I've got a ManageRelatedRecords page - lets call it "Activity". On my activity page I have a table that displays rows of items that can be of different types. One of the columns is a ViewColumn and depending on the type, it shows different content in the view....
Solution:
This might be stupid, but can you rename your action to Action::make('viewMoreDetails') ?

Wizard reset form

Is it possible to reset form for specific step in filament form wizard if I decide to leave and go back?

Global authorization on Laravel model level

I have two Laravel models: Web and WebOffer. For WebOffer i have Filament WebOfferResource. For WebOfferResource, there is great way to using authorization via Policy as described at https://filamentphp.com/docs/3.x/panels/resources/getting-started#authorization and basically i can easily define who can create WebOffer via implementing WebOfferPolicy#create() and that is all (Filament will do the rest). What if i would like to protect creating Web model which doesn't have any Filament Resource counterpart and which is created in WebOfferResource's "create" form ? Would it be good idea to create Laravel model Policy WebPolicy and Laravel's Observer like following: ``` class WebObserver {...

Error when making filament-user

i want to make a new user, but i encounter this error SQLSTATE[42703]: Undefined column: 7 ERROR: column "updated_at" of relation "web_users" does not exist LINE 1: insert into "web_users" ("email", "updated_at", "created_at"... ^ (Connection: pgsql, SQL: insert into "web_users" ("email", "updated_at", "created_at") values ([email protected], 2024-10-18 11:43:42, 2024-10-18 11:43:42) returning "id")...

Dynamic default repeater fields

For an application I am making a custom field which in essence is a repeater, a model can have custom fields which are configured in the config file. I want to load these fields as default in a repeater, how would I do this dynamically? I see that there is needed a list instead of an associative array for the default value, this is just somehow not possible I think?...
Solution:
The repeater’s schema is just an array of form components- you can load your config and build your array dynamically before assigning it to the form schema.

Table Split seems broken?

Latest version - no matter what I try it places elements in the wrong order. The last object in the array appear as the second item.
No description

Dynamically Populate Batch Number Select Based on Product Selection in Filament

Hi everyone,👋 I’m trying to populate a Select field for batch_number based on the selected product_id in Filament. I want the batch_number select to be dynamically updated after a product is chosen. Here’s the code I’m working with: ``` Select::make('product_id')...
No description

How have EditPage works both as modal and a page

I have this edit page, i do not want to comment the edit route in resource because i need it somewhere, but somehow in my custom livewire page i want also open this edit page as modal when click a button, instead of makeing a new livewire page with modal, how can i open the native edit page modal of filament?

how to properly show resource list with join or relation

I need to only show companies where user have access to in the list/table I tried doing this ```php...
Solution:
```php public static function getEloquentQuery(): Builder { if (auth()->user()->hasRole('super_admin')) { return parent::getEloquentQuery();...

my filament resource when i enter value its not saving in db and have error

this is my error ` SQLSTATE[HY000]: General error: 1364 Field 'value' doesn't have a default value INSERT INTO translations (alias, updated_at, created_at) VALUES (fafafafa, 2024-10-18 09:11:24, 2024-10-18 09:11:24) f but im enter value this is my code ```...