Maagalhaes
Parameters for index and create is it possible?
I want to do it like this:
I have the user resource that has a relationship with contracts, this is listed within the user's own editing screen using relation manager. When clicking on add contract, I would like it to open the contract resource on the creation page, but to do so I would need to take that user's ID. Is this possible with resources or would I have to change the way I'm doing it?
14 replies
Parameters for index and create is it possible?
The error remains
Action::make('create')
->label('Criar contrato')
->action(fn (?Model $record) => redirect()->route('filament.app.resources.contratos.create', ['record' => $record])),
I created the resource from the filament command. Looking at the create and index pages, they extend from CreatedRecord and ListRecords in the mount method, they do not receive the record unlike EditRecord. Could this be the case? If so, how can I get around it?
14 replies
Parameters for index and create is it possible?
I call it in my relation manager table like this:
Action::make('create')
->icon('heroicon-m-pencil-square')
->iconButton()
->action(fn (?Model $record) => redirect()->route('filament.app.resources.contratos.create', $record)),
In my ContratoResource:
public static function getPages(): array
{
return [
'index' => Pages\ListContratos::route('/'),
'create' => Pages\CreateContrato::route('/{record}/create'),
'edit' => Pages\EditContrato::route('/{record}/edit'),
];
}
So I get this error:
Missing required parameter for [Route: filament.app.resources.contratos.create] [URI: app/contratos/{record}/create] [Missing parameter: record].14 replies
TextInput does not add mask to field
Yes, here is the repository.
https://github.com/Maagalhaes/testing-input-mask
22 replies
TextInput does not add mask to field
Thanks for answering.
I'm using version 3.0 of filament. From the documentation it seems very simple to use, but the field is applying the mask only in the "change", when it loses focus, and alpine.js applies the mask as you type.
This package is interesting, I'm going to test it, but I'm still curious why my mask method doesn't work as it should.
22 replies