barrerakj
Display a custom page after login
Ok, thanks a lot. Can I ask you a bit more about it?
There are no certain conditions. I just want to show my custom page after login every single time. The idea of that custom page is for the user to pick some global values. Then I want to show the usual dashboard.
I was thinking that I can change the route when the user logs in correctly. Where can I find that? Should I publish some files or something like that?
4 replies
Get info of the selected record in AttachAction
Yes, here it is
AttachAction::make()
->recordSelectOptionsQuery(fn (Builder $query) => $query->where('existence','>',1))
->modalWidth('4xl')
->form(fn (AttachAction $action): array => [
Grid::make([
'default' => 1,
'sm' => 2,
])
->schema([
$action->getRecordSelect()
->columnSpan('full'),
TextInput::make('precioId')
->label('Precio')
->disabled()
->afterStateHydrated(function (callable $get, TextInput $component) {
//$component->state();
}),
TextInput::make('existenceId')
->label('Existencia')
->default(1)
->disabled(),
23 replies
Get info of the selected record in AttachAction
Also true. However, I tried adding reactive() to the $action->getRecordSelect(), so the closure $get works, but it returns a null, I think reactive() is not working as it does in regular forms/fields.
23 replies
How to refresh form fields after action?
As far as I can tell, no, it doesn't happen. Also, since I'm doing this in the View page, if I take any other action, like edit the resource or attach things in the relation manager, the field updates properly.
8 replies
How do I change the modal text of a custom Action?
Holly cow, it was the escaped quote I think. I guess I didn't notice that. I'm not even sure why did I not get a warning or other message. Thanks for the help. If it wasn't that, I can't explain why now it works.
5 replies
How to get the current relationship entry on a RelationManager action?
Hey, first of all, thanks for your help, I really appreciate it. Also, I've read this docs many, many times https://filamentphp.com/docs/2.x/admin/resources/relation-managers#attaching-and-detaching-records and there's not a single reference to that. Maybe there are some other docs about the AttachAction? I would love to read them.
I get what you're saying. That ID is exactly the one that I do not want. Because if I go to the relationship through the ownerRecord, that "product" ID is already in the pivot table, many, many times, since it's a many to many relationship. I just want the last record that Laravel created on that pivot table. Not the "order" record, not the "product" record, the one in between that was created in the pivot table.
21 replies
How to get the current relationship entry on a RelationManager action?
Ok, that's interesting. In my very simple example, what exactly is $data['recordId']? Is it the id of the product? Also, what is $data? Is it an instance of the RelationManager object?
21 replies