Filament

F

Filament

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

Join

Restoring repeater soft delete

TLDR: Is it possible to make it so that adding new repeater elements will recycle soft deleted rows in a pivot table first? Or would it fundamentally be a bad idea for a repeater to recycle soft deleted rows? Background: My app is setup so that everything is soft-deleted and referenced by shadow tables for data history and recovery. The only place where I'm concerned with my implementation is in the pivot tables for many-to-many relationships. The soft delete and shadow table all works, but if data is deleted, and then new elements are added to the repeater, it's added as new rows in the pivot table. This leads to a situation where I can accumulate a bunch of dead rows in the data, and makes developing a way to explore the history and restore an old state more difficult. It seems like ideally I would want to recycle soft-deleted rows first before creating new ones....

Reset paginate on resource

I was choosed paginate to all, and its fine cause I have a little few data. But when I run off the page, and my data was grow up till thousand and more, I click menu and my table keep paginate to all, causing maximum exeeded. How to fix this ? Should I reset my table to Resource ?...

Adding demo mode in filament application

Demo mode means the create/update/delete actions won't be applicable. I used to do this via middleware in Laravel but wanted to do similar thing but can't figure it out. Is there any easy way to add demo mode in a filament panel?...

url prepopulate username

Anyone know if you can pre-populate the username in a link? Tried: https://mydomain/login?data.username=random%40mail.com...

how to hide table records until a filter is applied?

how to hide table records until a filter is applied?
Solution:
```php ->modifyQueryUsing(function(Builder $query, $livewire){ if(!empty($livewire->tableFilters)){ if(...

Form Select, titleAttribute does not appear

I have the following tables: zero_ones(id, data) tests(id, zero_one_id [nullable and unique], data) I created a resource for "Test" and in the select input, I specified to only bring zero_ones that are not yet related to a test....
$query->doesntHave('test')

arch test example

How this pest arch test should be changed to work correctly? <?php use Filament\Resources\Resource; ...

url() is disrupting table columns

Hi folks, I am using table columns with combination of Split & Stack. Everything from layout perspective looks fine until I place url() in any of the columns. I have attached 3 scenarios to demonstrate the issue 1. In 1st picture I am not using url() anywhere and the layout looks what I expect it to be....

Selected records to widget

I currently have a Stat widget dispalyed on a resource. Is there a way to pass in what records are selected via the checkmark on Bulk Actions to the widget? The goal is to dynamically update the widget data based on the rows that are selected. I've been playing around with this for a bit and haven't been able to figure it out. From my github searching, I found "livewire->getSelectedTableRecords()" might be useful here, but I'm not positive how to pass that to the Stat widget....

Show multiple column data in a single table column.

I am trying to show 3 columns data in single Table column. But it show only blank. ``` Tables\Columns\TextColumn::make('properties')->label('Properties') ->formatStateUsing(function($record){ return "Length: {$record->length} \n Frames: {$record->frames} \n Size: {$record->size}M";...
Solution:
Ensure the "properties", is a valid property and is returning something otherwise (to my knowledge) it wont trigger formatStateUsing.

Relation Manager for pivot table

Hi everyone! Could do with some guidance please. I have the following models: 1. Sites 2. Services...

Hide clear icon on searchable select

Is there any way to hide the select component's clear button after you select an option? Like a normal select, When you select an option, user should not be able to unselect it....
No description

How to testing search select with dusk?

Can give me clue testing select and search option filament with dusk?

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