Filament

F

Filament

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

Join

import csv with pivot table

Hi everyone, how to import csv data and insert it to pivot table?

Broadcasting and Ably

Nothing happens when I do
```php $admin = User::first(); ...

Widget

How to customize default account widget?i want to add a "home button" that will redirect me to "/". Since it's just a single button,i want to just put it inside the account widget If what i said above can't be achieved,how to add a custom widget that only display the button instead?all the video on YouTube only show how to make chart widget...
Solution:
I recently had THIS video based on the Cachet dashboard with static texts/links: https://www.youtube.com/watch?v=usEpUVTE3TA

Run function while creating record not on editing.

Hi everyone, I'm working on a Filament project, specifically in the MovieManagementResource, and I want to run the generateDateSchedules method only when creating a new movie. I am trying to use request()->routeIs('filament.admin.resources.movie-managements.create') in the afterStateUpdated callback of the DatePicker, but it doesn't seem to be working. Here’s part of my code: Forms\Components\DatePicker::make('release_date') ->required() ->reactive()...
Solution:
Try operation: ```php ->afterStateUpdated(function (Set $set, Get $get, $state, string $operation) { if ($operation == 'create') { dd($operation);...

How to add NPM added assets to Filament.

I'm getting a little lost in the docs on this one. I'm looking to integrate https://swiperjs.com/ into a project and want to include the sources (js/css) in my project using NPM. $ npm install swiper...

Full page Livewire component not apply filament page layout

Hello I try creating custom view page on my resource. But I cant apply filament layout. Just there some couple of form element. My resource file: ```php <?php...
No description

auth()->user cannot be read after login in middleware ?

I have created a middleware and placed in app.php file on laravel side. I try to read value in every request but the problem is that I can't read any property from auth() after login. Yes, on the first request the auth() does not exist, but after login it should be readable. Moreover, I have placed some data in the Session::put('some_data', $data), even these data do not exist(I checked with debug). Thank you anyway!...

Can't mount existing data

I have a filament form that basically updates a user's info from MySQL. The data can post and save with no issues but I cannot pull specific tables to fill. How can you map this? Form: https://hasteb.in/pWukGVdaEgNub1o...
Solution:
You need to supply the data you want to fill to $this->form->fill()
No description

In a Table Filter, how can I query a JSON element that is an array instead of a value?

Hi, In a Table Filter, how can I query a JSON element that is an array instead of a value? For example, Let's assume the following in a column named data:...
Solution:
Figured it out: ```php SelectFilter::make('data->tags') ->label('Tags')...

Spatie media library responsive images

Could somebody please walk me through the process of creating responsive images using spatie media library plugin for filament on v3? all of a sudden the live version of my blog decided to stop showing images on mobile devices so now i have to generate images with different sizes. this turned out to be a faulty css (my mistake) Even though i refreshed the browser a few times on my phone nothing worked. Desktop version is doing fine. So anyway, i decided to try the spatie media library plugin but already it seems impossible to comprehend off of just the documentation. 😎 ...

Opening modal from Livewire Component

I'm trying to open a modal from a livewire compoenent: ``` public function createAction(): Action { return Action::make('create')...
Solution:
you need to do this if you are using actions outside the panel https://filamentphp.com/docs/3.x/actions/installation#existing-laravel-projects...

Add submit button to filament form in custom page

I have custom page called chat inside it i added filament form ``` { use InteractsWithForms;...

the image I uploaded does not appear in the table

the image I uploaded does not appear in the table, This error appeared after I deployed the project to the hpanel server.
No description

Filament::getPanel('dashboard')->getUrl() returns the wrong url

I have a laravel app, based on JetStream, I have two panels, Admin and Dashboard in my
resources/navigation-menu.blade.php
resources/navigation-menu.blade.php
I have this: ```...

Add label to split

Hello all, I want to add labels to split column in filament 3 table, I tried description but it shows them for each row and I want to be only in the top of table. Thank you all....
No description

Custom Filter Indicator removal to affect multiple fields removal

Hi, i have custom Filter with 3 fields related each other or dependent. From the filter drop down menu, if I am using field #1 and field #2, then remove #1, the other lower fields successfully resetting like what I intended. But, if I remove the filter from indicator, the lower field's filter persist and the table's data list not reset. ```php ->query(function(Builder $query, array $data): Builder { return $query ->when(...

import using xlsx by using filament action and transactional

Hello guys Is there any way so we can use importer by xlsx files instead of csv? And also is it possible to say import all or nothing in importer?...

2 Different Tables For The Same Resource

How can I have two different tables for the same resource with a different route for each. I want to have different fields for each and they both go to the same add/edit form?

Encryption disappears when adding a column.

When adding a column User Encryption is disabled, it does not work, and when logging in, a message appears that the password is incorrect.