Filament

F

Filament

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

Join

Applying Filters using $table->headerActions()

Hi, I have a quick question: If I have a table with a filter like: ``` ...

Did the mount() method get removed from Widgets?

I am using the #google-maps plugin where I have created a "custom" MapWidget, which used to update whenever the data was updated, but now this does not work anymore. So I found out that the mount() method in the vendor/cheesegrits/filament-google-maps/src/Widgets/MapWidget.php class is not being triggered anymore, and thought that this might be related to a recent Filament update affecting this, since this used to work. So should this method: ```php...
Solution:
Never mind, I overwrote the mount method in my map widget, which did not use the parent method.. It still works as before.

Convert model method to eloquent relationship

imagine this scenario tables: ```php Schema::create('users', function (Blueprint $table) { $table->id();...

Laravel Spark Stripe and Filament - subscriptions per user

Hi all, I'm struggling a bit with Laravel Spark Stripe and Filament. I noticed there's the spark-billing-provider for Filament, but I think it's designed for multi-tenancy and subscriptions per tenant. I'm building a setup to do subscriptions per user. Got the Laravel Spark integration working for the billing page and communication with Stripe. But I'm not figuring out how to check for these subscriptions, show banners below the top bar when someone is on a trial etc. Did anyone do this before, subscriptions per user? I'm in need of a small push into the right direction πŸ˜… ...
Solution:
Update: I used a custom blade file (subscriptionBanner) for the banner and attached it using a renderHook in the panel provider. It was as simple as that in the end πŸ˜… renderHook('panels::body.start', fn () => view('subscriptionBanner'), )...

Problem with Import Action - Import job never completes

I am having a problem with ImportAction. I want to use it to import products from CSV file. I am testing it with CSV file that has two rows in total. But when I run the action, job keep executing endlessly over and over, spamming failed_import_rows table. I am not sure why is it doing so. If it fails to import the records is should end the job in the end. I also created custom App\Jobs\ImportCsv job class that extends Filament\Actions\Imports\Jobs\ImportCsv job class and added property public $tries = 1; but that doesn't work either. If I inspect jobs table in the database I can see that the number of attempts is ridiculesly high, e.g. 15346. Then I need to stop the worker, remove the job from jobs table and clear the failed_import_rows table. This is how I resolve records in my importer class:...

Can I customize the login page of filament?

Solution:
If you say design it is even more simple, by just publish views and edit the file you want. php artisan vendor:publish --tags="filament-panels-views"...
No description

How should I use Filament in my system?

In my setup, users can have one of three roles: admin, doctor, or patient. Should I create a separate Admin PanelProvider for each role? Is that possible? My concern is that the default PanelProvider uses "admin" for its ID and path, so I'm wondering if I should create two additional providers with IDs and paths corresponding to each role. Or is it better and more recommended to use a single panel and restrict options based on roles, as is commonly done?
Solution:
It’s entirely up to you. Both methods will work. Just depends on what your app needs. But neither is right or wrong or necessarily better than the other.

Typing of getOwnerRecord and Filament::getTenant()

I'm currently using larastan to make sure my code is clean and fully typed, but i find myself to have to do a lot of code comments to make sure the code is properly typed both for my editor and larastan. I'm talking about stuff like this: ```php ->hidden(function (RelationManager $livewire) { /** @var Product $product */ $product = $livewire->getOwnerRecord();...

Don't allow user to delete notifications

how do i remove the delete button
No description

How to prefill resource field and run some calculations

I have an Invoices resource that has an action redirecting to the Credit Notes resource passing the invoice_id parameter: ``` ->action(fn($record) =>redirect() ->route('filament.admin.resources.credit-note.create', ...

Dynamic placeholder content renders HTML as text string not mark-up

Salut tlm, I have a Placeholder field that dynamically updates when a user a selects a venue to show an address. However, the placeholder renders the mark up as a string when updating the content dynamically. dynamically. ...
Solution:
God I'm an idiot - I'm typing the return as string - change it to HTMLString and all is good. Quack Quack, thanks for listening!
No description

Wizard issue with missing $statePath

I have a livewire component wizard that seems to be hitting intermittent issues for a very few users, I'm unable to recreate the issue. We're running the site on a load balancer, so it might just be a server or two playing up. I'm saving the form data to individual properties, rather than using $statePath, but occasionally the wizard seems to crash when moving to the next step production.ERROR: Filament\Forms\Components\Wizard::Filament\Forms\Components{closure}(): Argument #2 ($statePath) must be of type string, null given,...

Datetime field form validation in a wizard

Hi Newebie question here : I'm using always on my forms the ->after() method to validate the datetime , but i came accros with a situation where the 2 datetiome fields are in a separate step on the wizard, and the ->after('...') is not working in this case. Is there something I can do to validate all the fields through the whole wizard ?...

2nd panel with other authmiddleware

Hello everyone, I have another table with password, also the model that implements FilamentUser etc.., I made another Middleware and added the guard and provider for that specific model, made a custom LoginClass that extend Filament Auth -> Login, defined a route and despite this it doesn't work, the new view point to the default login with users table. ->login(CustomClass::class) ->authMiddleware([ CustomMidd::class ])...

Import action column mapping layout

Is it possible to adjust the layout with columns() Grid ot other layout options of the mapping modal in the ImportAction?

Receive parameters from programmatic action

I call an action from a livewire component, like this: <div wire:click="mountAction('addData', { id: {{$event['id']}} })" And this is the method that is called:...

Filters in page to change the widgets

Is there anyway to get the stats data to change as per the filters ?
I tried to use use BaseDashboard\Concerns\HasFiltersForm; but I did not get the filters in the top and. neither can access the filters in the widgets....

two forms one page

I'm on the edit route and I want to have a form that I use for adding comments. And for that form I need a button to be able to submit the form. Then the page also has the save changes action. I can't seem to find a way to add the comments form as an individual form that can be submitted individualy

Several admins who only have access to their resources

Hello, I'd like to create a website that allows users to create a portfolio to display photos. I would use Filament as an interface for managing albums, photos, etc. Each user would then be the admin of their own content and only THEIR content would be visible on their own filament interface....

Rich editor: Remove or style image captions, size etc.

Hello, I'm building a building a blog editor, and in my blog post I can't seem to style the caption under an uploaded image, it's just an a tag with an image inside, so no class or id to target it. I wanted to remove it as well but can't seem to find how....