thedangler
thedangler
FFilament
Created by thedangler on 1/19/2025 in #❓┊help
Pass withErrors to Registration Page
I over wrote the registration page to add some other fields. I also have a service that does an oauth login. If the oauth fails I redirect them to the Registration page. I've added a hook to the beginning of the form to display some errors. I want to show error messages I pass to that page, but for some reason return redirect(RouteServiceProvider::REGISTER)->withErrors('Employee information not found.','danger'); Does not pass the errors to the page.
2 replies
FFilament
Created by thedangler on 1/15/2025 in #❓┊help
Load Custom Page in a modal from slide out.
How can I load a filament custom page inside a modal from an action. I have a Custom page that extends Page. And from inside another custom page when I click on an action I want that other page to load. Action::make('test') >modalContent(view('filament.app.pages.store')) ->action(function ($record) { }) ->slideOver() this is an exmaple... it doesn't work.. Actually the modal doesn't even slide out. Basically I'm looking to render a Custom page inside the Slide out Modal. Thanks
2 replies
FFilament
Created by thedangler on 12/24/2024 in #❓┊help
Better way to check if relations exists for canAccess
I'm looking at a better way to check if relations exists for canAccess. A lot of the time I need to do something a long the lines of auth()->user()->merchant()->exists() so I can do the select Project::where('merchant',auth()->user()-merchant->id)->first(); Because as you know if merchant doesn't have a user yet the relation breaks so I have to check each time. Looking for some advice as this seems to be a recurring issue. thanks
1 replies
FFilament
Created by thedangler on 12/20/2024 in #❓┊help
Cluster page canAccess is being run when not going to that route.
Hello, I'm baffled why canAccess is being run in a cluster page app/Filament/Clusters/Connections/Pages/Connect.php When my route is app/Filament/Pages/Profile.php Does filament go through every can access when it loads? I found out it was breaking because I changed an id but that Id would be invalid for the cluster but the canAccess in my Profile page would have passed. Profile.php has nothing to do with cluster. is it because its being loaded as a link in the sidebar?
4 replies
FFilament
Created by thedangler on 11/23/2024 in #❓┊help
Help explain how filament knows to load the model for the form?
I'm looking at this code example to learn but I'm baffled how the form knows to use the model for the setting...??? line 13 protected static string $settings = AppSettings::class; How the hell does filament know to load that into the form... what magic is going on? I can't find how this component is even loaded. https://github.com/cachethq/core/blob/9b9a18683d4a38316c20bdb21b4bc25277f18f3b/src/Filament/Pages/ManageCachet.php#L9
2 replies
FFilament
Created by thedangler on 11/19/2024 in #❓┊help
How do you dispatch an event inside a custom page that isn't blocking with defer?
defer(function(){ $this->dispatch('customer-synced', '5XY7BSBN88S60'); }); When the dispatch isn't wrapped in a defer it works but it blocks.
2 replies
FFilament
Created by thedangler on 11/9/2024 in #❓┊help
Custom Page canAccess runs after mount ?
Noticed that canAccess runs after mount. Any way to make it run before. Or not show custom page navigation at all by modifying the route? Not sure how to change a custom pages link. Because they I could pass in the user or another model.
5 replies
FFilament
Created by thedangler on 10/30/2024 in #❓┊help
Custom Pages why can't I add multiple components to one page.
Why isn't there a function to draw a page. instead of only building out each component like form, infolist, table builder. For example have a function Page(Page $page) return $page->section->("form")->schema([$this->getForm])->section->("Info")->schema([$this->getInfoList(),$this->getTable]) This is an example and I'm sure you get the point.
2 replies
FFilament
Created by thedangler on 5/8/2024 in #❓┊help
After Login in, Dashboard design is all out of wack.
Once logged in, I have to refresh the page to fix the layouts. For example the Profile link top right is cut off and shows the menu out of the screen when it should be hidden. The left nav overlaps the content. Not sure why it doesn't render properly after login, but after a refresh it works fine.
16 replies
FFilament
Created by thedangler on 4/13/2024 in #❓┊help
Pass record to infolist from action
I have a table view action that has a slideover. I'm passing it an info list. I can't seem to pass the current record over. I want to show/hide a button when there is a relationship. How do I pass the current record to the infolist Action::make()->infolist([ entries..... if(record.doesntHave('relationship')->get()) show action button to create the missing relation ship. ])->slideover()
4 replies
FFilament
Created by thedangler on 4/9/2024 in #❓┊help
infolist repeater action get element
inside an action how do I get the element that is in the infolist. The info list is built like $infolist->state(['templates' => $this->templates // which is a collection turned into an array. inside the repeater I'm trying to add a button to assign something to the livewire component but when i do Action::make('action')->action(function(what goes here){ dd($current_item); }) I tried function(Array $item) I tried function(Template $template) its always null. Thanks.
2 replies
FFilament
Created by thedangler on 3/27/2024 in #❓┊help
Table with slideout infolist
Hello I have an infolist in my \Pages\ViewModel. I want to us that infolist inside the table action of my resource. ViewAction::make()->slideover() I don't want to copy my info list in two places and have it in my resource and my \Pages\ViewModel How can I reuse the \Pages\ViewModel $infolist in the resource table slideout.
3 replies
FFilament
Created by thedangler on 3/26/2024 in #❓┊help
How come state breaks infolist
<x-filament-panels::page> {{ $this->infolist }} <x-filament-panels::form wire:submit="save"> {{ $this->form }} <x-filament-panels::form.actions :actions="$this->getCachedFormActions()" :full-width="$this->hasFullWidthFormActions()" /> </x-filament-panels::form> </x-filament-panels::page> When save is clicked the following funciton runs. public function save(): void { try { $data = $this->form->getState(); // this breaks the info list. My infolist has nothing to do with $this-form. $this->handleRecordUpdate($this->record, $data); } catch (Halt $exception) { return; } $this->getSavedNotification()->send(); } How can I save it without getState triggering a reload of my infolist ?
4 replies
FFilament
Created by thedangler on 3/26/2024 in #❓┊help
Using query string parameters to pre load form
Is there a way to get query string parameters in the Resource to pre set some fields. I have to built a project from a subscription. From the subscript resource I click on the subscription and want an action to take me to create the project with the subscription id / info pre populated. Since its a create the model has nothing in it but I can't seem to find an on load, mount or anything that lets me set model attributes before it loads the form.
1 replies
FFilament
Created by thedangler on 3/16/2024 in #❓┊help
Navigation Groups & navigationParentItem not working
Hello, I have a ViewPage and its $navigationGroup is set to 'Group' but the link doesn't show up under it. Even if I try to set a page to a $navigationParentItem it doesn't work. What am I missing?
7 replies
FFilament
Created by thedangler on 3/15/2024 in #❓┊help
Update table from external form.
Very simple, I do not want to load the table until a form and new query is created. But is seems like $table->query() gets called way to early in the cycle. How can I modify the $table->query() when an outside form changes something that effects the query?
9 replies
FFilament
Created by thedangler on 3/14/2024 in #❓┊help
Sushi with 3rd party api request loading table strange issues.
using sushi to get 3rd party api to be placed in a filimant table. When I use sushiModel::query() works, but I need to pass it a param sometimes to adjust the request. However when I use sushiModel->query() causes issues where the table loads before the query is returned. Causing bulk save to not work, popping up modal when submitting my form. Crazy stuff. I use sushiModel->query to add a filter to the api request to re-run the query but it causes some crazy issues. Wondering what exactly changes from static query to method call query and why form->query(model->query()) doesn't work as well as (model::query())
1 replies
FFilament
Created by thedangler on 3/14/2024 in #❓┊help
Very odd behaviour with calling a function but modal opens instead.
Very odd behaviour is happening. I have a form over top of a table. In the form I have a datetime picker to set a date to go fetch data from an API. I have a filter button which applies the data. It loads the data refreshes the table with the data. I also have a table with bulk actions. When I run a bulk action save. The table goes blank and nothing works. If I press the Filter button to set the datatime in the form. It pops up the modal from the bulk save. Always, until I refresh the page. It also never calls my save function, only pops open an modal.
return $form->
schema([
Grid::make()->schema([
DateTimePicker::make('start_date')
//->live()
->label('Filter Start Date')
->native(false)
->closeOnDateSelection(),
Actions::make([
Action::make('setStartDate')
->label('Set Filter')
->action(function () {
$this->applyFilter();
})
])->verticalAlignment(VerticalAlignment::End),

]),
]);
return $form->
schema([
Grid::make()->schema([
DateTimePicker::make('start_date')
//->live()
->label('Filter Start Date')
->native(false)
->closeOnDateSelection(),
Actions::make([
Action::make('setStartDate')
->label('Set Filter')
->action(function () {
$this->applyFilter();
})
])->verticalAlignment(VerticalAlignment::End),

]),
]);
Table
return $table
->query($this->query)
->columns([
TextColumn::make('customerName'),
TextColumn::make('customerEmail'),
TextColumn::make('id')
])
->bulkActions([
BulkAction::make('Save')
->button()
->action(fn(Collection $records) => $this->saveOrder($records)),
]);
return $table
->query($this->query)
->columns([
TextColumn::make('customerName'),
TextColumn::make('customerEmail'),
TextColumn::make('id')
])
->bulkActions([
BulkAction::make('Save')
->button()
->action(fn(Collection $records) => $this->saveOrder($records)),
]);
Two functions
public function saveOrder($records)
{

dd($records); // this never gets run

}
public function saveOrder($records)
{

dd($records); // this never gets run

}
2 replies
FFilament
Created by thedangler on 3/13/2024 in #❓┊help
Livewire function is being called after Table is rendered
I have a action that calls a livewire function to add a filter to a db query. But the function call is being run after filament calls the table() function. So its always not applying my custom filter. Not sure how to tell it to load the table after my filter call.
1 replies
FFilament
Created by thedangler on 2/27/2024 in #❓┊help
navigationParentItem and navigationGroups issues
Hello. For the life of me I can not get custom page to show in a navigationGroup or navigationParentItem. If I add a resource to the group it works but not a custom page. Also, probably somehow related. I can not get navigationParentItem to work at all. If I have a Page and I set a page navigationParentItem = 'Page' It doesn't show, or give any errors. I have the latest Filament Installed. This is driving me insane.
2 replies