rich06
Infolist RepeatableEntry with an Array
I am trying to create an Infolist RepeatableEntry using data from an array and it doesn't seem to generate any output..
The source array originates from a JSON column in the DB and is as follows:-
[
"15 minutes" => "17",
"30 minutes" => "26",
"45 minutes" => "42",
"60 minutes" => "52",
]
Based on the example repeater code here https://filamentphp.com/docs/3.x/infolists/entries/repeatable#overview it shows the list being built using TextEntry
items each having a name/key. In this case there are no labels... so I tried re-formatting the array as follows:-
[
["id" => "15 minutes","val" => "17"],
["id" =>"30 minutes" =>,"val" "26"],
["id" => "45 minutes" =>,"val" "42"],
["id" =>"60 minutes" =>,"val" "52"],
]
and using TextEntry::make('id')
and TextEntry::make('val')
but still nothing appears...
Anybody help? Thanks!4 replies
Table recordUrl() to open a modal?
I have a custom page with a table which should open a view type modal when the row is clicked. I already have a ViewAction button defined for each row which loads the modal. However https://filamentphp.com/docs/3.x/tables/advanced#record-urls-clickable-rows only deals with opening a new page not a modal and I can't seem to configure
$table->recordUrl()
to open a modal...
Anyone give me a pointer here? Thanks!16 replies
Add optional parameter to register page - won't render form
I need to add support for an optional passed affiliate code to the user registration process so I created a custom page that extends the
Filament\Pages\Auth\Register.php
class with a mount()
function that accepts an optional parameter and created a new route in web.php as follows:-
Route::get( '/register/{code?}', [\App\Filament\Pages\Auth\Register::class, 'mount'] )
->name( 'filament.public.auth.register');
The name replaces the name of the standard Filament generated route. So far so good...
When I enter the default path with no code i.e. <url>/register
I can see that the new mount is being called and the code is being defaulted and the form is rendered no problem. However as soon as I append a code i.e. <url>/register/1234
the new mount()
method is called fine but the form (or view) does not render i.e. it is a completely empty page with no mark up at all..
I tried adding an override render() method but it does not get called at all and there is nothing logged by Laravel and no JS/LW errors logged either...
Is there something I have missed?4 replies
SpatieMediaLibrary Image upload weirdness
I am building a user maintenance form which includes the ability to upload 3 profile images. The image uploads are handled using the SpatieMediaLibrary form control.
The control seems okay when new images are added in that the media table is populated and the files are saved to disk fine. However if (for example) there are 3 images already uploaded and 1 image is deleted from the collection then when the form is saved all the images get deleted from storage but the 2 media database table entries remain which point to non-existent files. So Is there something I've missed here?
21 replies
KeyValue - possible to mask/validate format for entered values before saving?
Is it possible to apply an input format (numeric) to KeyValue input values? I would like to ensure the user only inputs a numeric value if that's possible?
Thanks!
2 replies
RelationManager getTableQuery() returns null
It is not documented in the upgrade v2 -> v3 section but I'm trying to customise the table query for a relation manager. Previously I used to override the getTableQuery() by adding methods to parent::getTableQuery() but in v3 that function returns a hard coded null.
So how do I customise the relation manager now?
Thanks!
5 replies
User table list omits the status column
I created a resource for managing the users table and one of the columns on the table is called 'status'. For some bizarre reason this column does not get listed in the table. If however I change the column name in the database to something other than 'status' then it will be displayed/listed normally....
Table code as generated by filament when the resource was created is:-
Tables\Columns\TextColumn::make('status')
->searchable(),
Any ideas?43 replies
No property found for validation
I am trying to implement a custom registration form for a new v3 filament install and am following the instructions here -> https://filamentphp.com/docs/3.x/panels/users#customizing-the-authentication-features
So I created a new Page (
App/Filament/Pages/Auth/Register.php
) and this class extends Filament\Pages\Auth\Register
and has a single function as follows:
public function form(Form $form): Form
{
return $form
->schema([
$this->getNameFormComponent(),
$this->getEmailFormComponent(),
Select::make( 'usertype' )
->options( ['client' => 'Client','provider' => 'Provider'] ),
$this->getPasswordFormComponent(),
$this->getPasswordConfirmationFormComponent(),
]);
}
The custom form displays the new select dropdown fine however whenthe form is submitted the following Exception gets thrown:-
No property found for validation: [name]
I added a call to dump out $this->form->getValidationRules()
at the top of the register()
method of the parent Filament\Pages\Auth\Register
class and it shows the array of validation rules are there (including the 'usertype
' field...
Can someone tell me what I have missed here? Thanks!5 replies
I have a custom page that needs to load a second page with a parameter
I have created a custom page that allows the user to select a payment plan then when they confirm it will load a second custom page with an URL parameter of the selected payment plan id so the user can confirm and load a payment form.
I cant get the second page to load the view when a parameter is passed. I created a route to load the Component's mount() function with the ID parameter and I can dump out that the parameter is being successfully passed and injected into the mount() method of the second page but the view doesn't get loaded - just a white screen with nothing logged.
If I remove the parameter and route definition then the view gets loaded..
I am new to Filament (this is V2) and Livewire so what am I missing? Why will it not load the view that is defined in the component when a parameter is passed/injected into the mount method?
TIA for any guidance!
21 replies
Skip table list go directly to edit page
This question is for a Filament Admin v2 installation.
For non-admin users on my site they are to have the ability to modify some basic details of their organisation. Currently, for the organisation resource menu link they correctly see the table listing just their own organisation so they click on edit to make their changes.
However, what I want is for the user to skip seeing the single organisation list and be dropped directly into the edit page which I understand can be best done with a redirect() to the correct edit route.
However where do I add the call to redirect()? The resource class has many static functions and I can't seem to see an 'init()' or 'setup()' type function that I can override.
4 replies
Relation manger update change field on parent form?
Is it possible for a change/create of a child record in a relation manager to update a field on the parent form?
I have a parent resource form that displays the number of active child table rows. If the user adds a new active child record I'd like the count field to change automatically. Is this possible?
Thanks
9 replies
Get parent record in Relationship Manager
Hi, I am building the create/edit form in a relationship manager and I need to create a Select dropdown list of rows that are related to the parent row. How do I access the parent row in the form section of a relationship manager?
11 replies
Use custom javascript for a modal edit form?
I am using the Filament admin package and am using modal create/edit forms for user resource maintenance. In order to provide a better UI experience I would like to use a custom JS library for the contact phone number input field.
I know I can inject custom JS/CSS when Filament boots up however I need to bind the JS function to the input field once the modal has been opened so is there a 'modal-open' (or similar) event I can create a listener for?
9 replies