403gtfo
403gtfo
FFilament
Created by 403gtfo on 4/10/2025 in #❓┊help
Pass filter data to Sushi model
I'm kind of bastardizing Sushi and making my own model data on the fly (with blackjack and hookers) 😛 Basically by forming an array in the sushi model some fields of which are calculations based on the filters like x number of y in year n. This allows me to use the searchable and sortable methods in the filament table which normally break when you use formateStateUsing(). So basically dynamic static sushi data fun time muahahahahahhaha It works now and I am super happy about it. I just had to check for the empty start to address the reset button.
if (isset(request()->query()['tableFilters'])) {
$year = request()->query()['tableFilters']['filters']['year'];
Session::put('equis_table2_year', $year);
} else if (isset(request()->input('components')[0]['updates']['tableFilters.filters.year'])) {
$year = request()->input('components')[0]['updates']['tableFilters.filters.year'];
Session::put('equis_table2_year', $year);
} elseif (empty(request()->input('components')[0]['updates'])) {
$year = date('Y') - 1;
}
if (isset(request()->query()['tableFilters'])) {
$year = request()->query()['tableFilters']['filters']['year'];
Session::put('equis_table2_year', $year);
} else if (isset(request()->input('components')[0]['updates']['tableFilters.filters.year'])) {
$year = request()->input('components')[0]['updates']['tableFilters.filters.year'];
Session::put('equis_table2_year', $year);
} elseif (empty(request()->input('components')[0]['updates'])) {
$year = date('Y') - 1;
}
10 replies
FFilament
Created by 403gtfo on 4/10/2025 in #❓┊help
Pass filter data to Sushi model
Now I just have to deal with when the user clicks reset... I should be able to fire an action on that I think.
10 replies
FFilament
Created by 403gtfo on 4/10/2025 in #❓┊help
Pass filter data to Sushi model
if (isset(request()->query()['tableFilters'])) {
$year = request()->query()['tableFilters']['filters']['year'];
Session::put('equis_table2_year', $year);
} else if (isset(request()->input('components')[0]['updates']['tableFilters.filters.year'])) {
$year = request()->input('components')[0]['updates']['tableFilters.filters.year'];
Session::put('equis_table2_year', $year);
} else {
$year = Session::get('equis_table2_year');
}
if (isset(request()->query()['tableFilters'])) {
$year = request()->query()['tableFilters']['filters']['year'];
Session::put('equis_table2_year', $year);
} else if (isset(request()->input('components')[0]['updates']['tableFilters.filters.year'])) {
$year = request()->input('components')[0]['updates']['tableFilters.filters.year'];
Session::put('equis_table2_year', $year);
} else {
$year = Session::get('equis_table2_year');
}
Clunky I know... but I only have 2 filters to care about so works for me and beats the lifecycle BS that was stopping me.
10 replies
FFilament
Created by 403gtfo on 4/10/2025 in #❓┊help
Pass filter data to Sushi model
"which I feel it might." it does... ok I can still work around that with sessions.
10 replies
FFilament
Created by 403gtfo on 4/10/2025 in #❓┊help
Pass filter data to Sushi model
YES!!! I think I got it working. More testing required. I found the filters in request() and it works!!!!!!
$year = (isset(request()->query()['tableFilters'])) ?
request()->query()['tableFilters']['filters']['year'] :
request()->input('components')[0]['updates']['tableFilters.filters.year'];
$year = (isset(request()->query()['tableFilters'])) ?
request()->query()['tableFilters']['filters']['year'] :
request()->input('components')[0]['updates']['tableFilters.filters.year'];
The true condition works on initial page load (as I have a default value in the filter. the false condition is where the updated state is. I need to add another filter to test if the [0] index goes walk about and make sure it doesnt lose it if another filter is changed... which I feel it might.
10 replies
FFilament
Created by Trauma Zombie on 2/21/2025 in #❓┊help
Need two tabs with two different tables with two different models on one page
I'd take a look at this. Make 2 livewire components that each create a table, and a view that includes them. Not sure how well it would go about insulating cross contamination. But that should get you started 🙂 https://filamentphp.com/docs/3.x/tables/adding-a-table-to-a-livewire-component
2 replies
FFilament
Created by Dmitriy on 2/21/2025 in #❓┊help
TextColumn throwing an exception for the empty ENUM value
I swear to the tech gods the number of times enums have caused my headaches during my filament projects. Unless you NEEEEED them, stay away and just control it in logic. (Sorry not answering your question, but just ranting)
12 replies
FFilament
Created by lr on 2/23/2025 in #❓┊help
Save changes not working for records with multiple ids?
Have you customized the edit form (other then adding fields and such)? Otherwise 9 out of 10 times this happens to me is I forgot to add the additional field to the model's $fillable and am testing on different fields. Try updating the same field on multiple records and see if it works. Just a crazy thought.
3 replies
FFilament
Created by Ralph Morris on 1/28/2025 in #❓┊help
Creating Exporter with custom data
I like to use, and would absolutely recommend, eightynine/filament-excel-import. It's super easy to use and you can make your own importers while leveraging their UI and process. @eightynine
5 replies
FFilament
Created by 403gtfo on 1/27/2025 in #❓┊help
Table CSS for Livewire Page outside Filament
OTL of course.... I can't believe I missed that.... it works now. Thank you!
12 replies
FFilament
Created by 403gtfo on 1/27/2025 in #❓┊help
Table CSS for Livewire Page outside Filament
I just used the one the filament guys wrote (may be out of date now)?
12 replies
FFilament
Created by 403gtfo on 1/27/2025 in #❓┊help
Table CSS for Livewire Page outside Filament
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>{{ $title ?? 'Page Title' }}</title>

@vite('resources/css/app.css')
</head>

<body>
@yield('title')
@yield('content')

@vite('resources/js/app.js')
</body>

</html>
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>{{ $title ?? 'Page Title' }}</title>

@vite('resources/css/app.css')
</head>

<body>
@yield('title')
@yield('content')

@vite('resources/js/app.js')
</body>

</html>
12 replies
FFilament
Created by 403gtfo on 1/27/2025 in #❓┊help
Table CSS for Livewire Page outside Filament
I'll try give it another run through... but it all works normally once you are in the normal filament area /admin/.... iit's just this one table embedded in a view.
12 replies
FFilament
Created by gausoft on 8/18/2024 in #❓┊help
How to use different logos for the login and the sidebar ?
Neat 🙂 TIL. In my case I am doing other dark magic muahahahaha
12 replies
FFilament
Created by gausoft on 8/18/2024 in #❓┊help
How to use different logos for the login and the sidebar ?
No description
12 replies
FFilament
Created by Neamix on 11/4/2024 in #❓┊help
Call a function after change SelectFilter
Try ->afterStateUpdated( ) Link to Doco: https://filamentphp.com/docs/3.x/forms/advanced#field-updates
3 replies
FFilament
Created by Neamix on 11/4/2024 in #❓┊help
Dynamic Filter
I've done some similar stuff. You can use a combination of Get, hidden(), live(), and a function in your options() Get - Gets another field's value live() - lets the field update after load hidden() - Use a function with some logic on pet_specie_id that uses Get to check pet_type_id. If pet_type_id is not set hide pet_specie_id options() - again, use a function with logic in pet_specie_id that Gets pet_type_id and pulls the right option array. There is probably a nicer way, but hope this puts you on the right path. Also side note: if you add swift after the three backticks in your code block it will color code stuff like this:
Test::make('this')->live();
// Cool huh
Test::make('this')->live();
// Cool huh
Link to doco: https://filamentphp.com/docs/3.x/forms/advanced#injecting-the-state-of-another-field
3 replies
FFilament
Created by joao nivaldo on 10/24/2024 in #❓┊help
Change relation manager label
It'll be one of these little vars in that file I sent the path to.
12 replies
FFilament
Created by joao nivaldo on 10/24/2024 in #❓┊help
Change relation manager label
Ooooooo I see yup Try
swift
protected static ?string $label = 'something
swift
protected static ?string $label = 'something
Sorry I didn't realize with the different language sorry.
12 replies