Husky110
Colorchange on Stateupdate not working in Infolist
Hi - I got an infolist that is filled via the state-function. When I update the state via an action like this:
The according IconEntry that handles connection.status updates it's icon, but not it's color.
What can I do to acchieve this?
Here is the IconEntry-Code:
2 replies
Table-Widget-Problem (call to a member function table() on string)
Hi - I'm having trouble setting up a table-widget. I've created the widget via
php artisan make:filament-widget ArticleStocksWidget --table
, linked it to the ArticleResource and marked "The [console] panel".
I've registered the widget within the resource and added it to the getHeaderWidgets
in my "ViewArticle"-Page.
When I try to display said widget, I get a blank space where it should be and then the display-error "call to a member function table() on string" pointing to my ->columns-method. My table-function looks like this:
FrontendCacheReservedStocks is a regular Model.
Anyone have a clue on where to look here?6 replies
Password reset-Mails are not beeing sent, eventho Mails are correctly configured
Hi - I'm having trouble getting password-resets to work.
When I am in the form to enter the mailadress, I can input an e-mailadress and get the "We have emailed your password reset link."-notification, but I do not get the e-mail itself.
I have already verified that sending mails itself works fine, since I have a form inside the app that sends mails and those E-Mails are beeing sent. So sending via
Mail::to()
works (including apropriate .env-variables).
I also have veryfied that the App\Models\User-Model has the CanResetPassword
and Notifyable
-Trait which are required by Laravel. I did not add any other additional code or anything.
Does any one have an idea where else to look for the problem?4 replies
Rebuild Infolist
Hi - again I'm having a problem with my infolist. The background is this - I have a Model called "Checkpoint" that has a BelongsToMany-Relation to a Model called "Tag". Now I've added an action to remove a tag from a checkpoint. Problem is, that when I click on the action, the tag still persists on the page, until it is reloaded. Is there a way to reload that section or the infolist automatically?
->live()
seems to be not available here. This is my code so far:
4 replies
Wizard with depending steps in an action
Hi - I am trying to achieve a multi-step import.
The steps should be:
1.) Input an URL
x) Do some validation against an API
2.) Select Specifics
3.) Import
I am struggeling on the x-part. It is possible that the user gives in a false URL (outside of scope, URL points to wrong datatype and whatnot).
I have two questions here:
A) Is it possible to keep the user in step 1 and display an error if he/she gives in false data? If so - how?
B) Is there a way to build up the schema for step 2 dynamicly based on the validation done for question A? If so - how?
Thanks. 🙂
4 replies
Modify Builder Delete-Action
Heyho,
I'm having a Builder that builds blocks which then on save contain data for multiple models. Right now I face two problems:
1.) Is there a way to require a confirmation before the delete-action on that block is performed?
2.) How can I access the block that is about to be deleted, so I can perform the appropriate database-operations?
Thanks in advance. 🙂
17 replies
Displaying a modal after action has been performed
Hi - I want to create a table action (like add it on each row) where a user clicks on a button, it performs an action (connection-check in this case) which returns either true or false. Afterwards I want to see a modal with either "success" or "failure". Now from what I get so far, I can create modals BEFORE an action has been performed (like confirmation modals or form-modals), but how do I do that AFTERWARDS? I could do the workarround by opening a modal, adding a button and update said modal, but that is not elegant enough for me. Is there a way to do it like "click button" -> "perform action" -> "show modal with content concering the action-result"?
Thanks in advance. 🙂
23 replies
Question about security and registering new users
Hi there.
My question is this:
As far as I understand it, all Filament-Pages and -Resources are behind the "auth"->guardian and the
canAccessFilament
-function is called when a page or resource is accessed. Right?
Right now I wanna do 2 things:
1.) I wanna add an "active"-column to my user-table. Is it enough to add return $this->active
to said function to block all non-active users from entering? (Filament IS my frontend, so there is nothing else to be accessed.) If anyone has an idea on how to do this non-Filament-related: Please share! I could only find solutiuons that use Breeze as a package, but not Filament.
2.) On my old frontend, I have a system in place to register new users, where an existing user enters an e-mailadress which then receives a token, that is beeing used as a parameter in a url. How can I adapt that to filament? Like making the page accessable even without logging in and checking the parameter?53 replies
Selfupdating / On-The-Fly / Dynamic Modal Form on Resources (Tutorial)
Hey - so this is a follow-up to #Selfupdating Modal-Form and an attempt to better state the problem and provide the found solution for future use.
The problem:
Let's say you have to create an Action on a Resource (table) but the required form-entries (like which Inputs are required, which selects, or whatnot) depend on the record or a relation on the record you are working on. (I'm using the EditAction for this, but this should work on any other action as well!)
In my scenario the form-content relied on a model called "Config" and to add method to the madness, a secondary model we call "Parent". In here we call the model that the Resource displays just "Entity", to avoid confusion. So Entity belongs to Parent via parent_id. Config belongs to parent via parent_id. Entity and Config are linked via a BelongsToMany-relationship with a pivot-value called "value", which holds the set value. Now we have a Select on our form that set's the parent_id for Entity and we want the form to display all Config-models with the same parent_id as our select currently uses as selected value and update itself whenever the selected value (parent_id) changes.
The following thread will provide the solution to this, which has been found with extensive help of @pboivin and a pointer in the right direction by @smiliyas. Thank you guys. 🙂
Let's say you have to create an Action on a Resource (table) but the required form-entries (like which Inputs are required, which selects, or whatnot) depend on the record or a relation on the record you are working on. (I'm using the EditAction for this, but this should work on any other action as well!)
In my scenario the form-content relied on a model called "Config" and to add method to the madness, a secondary model we call "Parent". In here we call the model that the Resource displays just "Entity", to avoid confusion. So Entity belongs to Parent via parent_id. Config belongs to parent via parent_id. Entity and Config are linked via a BelongsToMany-relationship with a pivot-value called "value", which holds the set value. Now we have a Select on our form that set's the parent_id for Entity and we want the form to display all Config-models with the same parent_id as our select currently uses as selected value and update itself whenever the selected value (parent_id) changes.
The following thread will provide the solution to this, which has been found with extensive help of @pboivin and a pointer in the right direction by @smiliyas. Thank you guys. 🙂
11 replies
Empty model on mountUsing
Hi - I am building an EditAction on a Resource and want to use
mountUsing()
. I followed the docs at https://filamentphp.com/docs/2.x/tables/actions#filling-default-data and made my function look like this:
But the modal it not beeing filled up. The form-elements themselfs are there, but have no values. DeliveryChannel is the Model bound to the Resource. A dd($deliveryChannel)
revealed that the function receives an empty model.
Does anyone have an idea on how to get the actual model I've clicked on the table?7 replies
Display Relationshipvalue in View-Form on Resource-Modal
Hi - Since Discord decides to bug out on the search-function and scrolling the result and I can't find it anywhere, could someone please point me in the right direction?
I got a Resource and wanna do a quick view-action, so I build up the
form()
-method like this:
The fields on the record itself work fine, but the RelationShip-Fields on "myrelation" are empty. I found how to fix that on selects, but not on TextInputs. How can I fill those fields with their respected values? (I don't think that I have a typo on the notions.)8 replies
Using a custom component in a Form
Hi - I think I've overlooked something here. I am creating a livewire-component to show an overview, which is then polled every 10 seconds. So I made a new component via
php artisan make:livewire mycomponent
and now I wanna use that within getFormSchema()
inside a section, but it does not have the usual ::make()
function, which all FilamentComponents have. Do I have to define a make
-function myself or just use some Trait?38 replies
Auto-Enable Toggle
Hey - As the title suggests: I'm trying to auto-enable a toggle-button. I tried treating it like a checkbox via
Toggle::make('MyToggle')->default(true)
but to no avail. I tried to use 1 or "on" as states, still nothing. Anyone has an idea on how to acchieve this?14 replies
Filtervalue in query
Hi - I want to create a select-filter where a user can filter any data that has not been updated within in the last 12, 24 or 48 hours, which then would modify the query like
where('updated_at', '<=', Carbon::now()->subtractHours($x));
now I got as far that I would have to modify the query
-function, but so far I've only seen it like fn($query) => $query->where('xyz', 'abc')
how do I add the current filter value to that? Utilizing the whole formbuilder-component seems a bit overkill here. Is there an easy way?10 replies