icolatsi22
icolatsi22
FFilament
Created by icolatsi22 on 6/16/2024 in #❓┊help
Repeater rolls back after save
Ok, the problem was not with the naming, you can use "Order", the problem was with an accessor I had added. For some reason it messed up the repeater. So, for next time I need to be careful about accessors on models. Adding this comment for the future.
9 replies
FFilament
Created by jey on 6/16/2024 in #❓┊help
send an email after creating a record
you can use filament's Lifecycle hooks or laravel's model event hooks, like created() methods. So after your model is created you can do whatever. There's other methods too
9 replies
FFilament
Created by jaocero on 6/16/2024 in #❓┊help
Is there any way to create a custom page but not under in a tenant? Its like a general page
search for shouldRegisterNavigation on the docs
7 replies
FFilament
Created by icolatsi22 on 6/16/2024 in #❓┊help
Repeater rolls back after save
Ok, just an FYI for the future... So i changed everything to use 'ClientOrder' instead of 'Order' now it works as expected. Not sure what the real problem was, but seems 'Order' can cause a conflict, at least in this scenario 🤷‍♂️
9 replies
FFilament
Created by icolatsi22 on 6/16/2024 in #❓┊help
Repeater rolls back after save
i'm now recreating the models but using different names "ClientOrder" instead of "Order". Maybe using "Order" somehow or somewhere causes an issue, never seen this problem before.
9 replies
FFilament
Created by icolatsi22 on 6/16/2024 in #❓┊help
Repeater rolls back after save
yep, fillable and cast properly as well. Changes are saved to the database correctly, but the old value is returned after hitting save. Like the old state is being used to fill the form, weird...
9 replies
FFilament
Created by Razuro on 6/16/2024 in #❓┊help
Relationship model policies and authorisation on Select Form fields
something like this...
->options(function () {
$user_role = auth()->user()->getRoleNames()->toArray()[0];
$allowed = $allowedOptions[$user_role];
// Event::whereIn('xxx', $allowed)...
}),
->options(function () {
$user_role = auth()->user()->getRoleNames()->toArray()[0];
$allowed = $allowedOptions[$user_role];
// Event::whereIn('xxx', $allowed)...
}),
If you have multiple roles, change the way you build the $allowed
8 replies
FFilament
Created by Razuro on 6/16/2024 in #❓┊help
Relationship model policies and authorisation on Select Form fields
The way I've done it in the past is, I use a custom query for the select. So the select gets different options per role. Maybe you can create an $allowedOptions array
$allowedOptions = [
'admin' => [allowed options used in the Select 'where' query],
'client' => [allowed options used in the Select 'where' query],
];
$allowedOptions = [
'admin' => [allowed options used in the Select 'where' query],
'client' => [allowed options used in the Select 'where' query],
];
(Problem is this is hard-coded. You can create a model to store these so you can edit them)
8 replies
FFilament
Created by jaocero on 6/16/2024 in #❓┊help
Is there any way to create a custom page but not under in a tenant? Its like a general page
i used 'parameter' as an example, you can use whatever: /{user_id} mount($user_id)
7 replies
FFilament
Created by jaocero on 6/16/2024 in #❓┊help
Is there any way to create a custom page but not under in a tenant? Its like a general page
oh, and you can access the parameter in mount method in the page:
public function mount($paramater): void
{
...
}
public function mount($paramater): void
{
...
}
7 replies
FFilament
Created by jaocero on 6/16/2024 in #❓┊help
Is there any way to create a custom page but not under in a tenant? Its like a general page
You can, create the page and add a custom route for it in web: Public Page (no login):
Route::get('/custom-page/{parameter}', \App\Pages\CustomPage::class)
->name('custom-page');
Route::get('/custom-page/{parameter}', \App\Pages\CustomPage::class)
->name('custom-page');
Private Page:
Route::get('/custom-page/{parameter}', \App\Pages\CustomPage::class)
->name('custom-page')->middleware(['auth']);
Route::get('/custom-page/{parameter}', \App\Pages\CustomPage::class)
->name('custom-page')->middleware(['auth']);
7 replies
FFilament
Created by Wim on 6/16/2024 in #❓┊help
Check upon login
No description
4 replies
FFilament
Created by Wim on 6/16/2024 in #❓┊help
Check upon login
No description
4 replies
FFilament
Created by icolatsi22 on 6/16/2024 in #❓┊help
Repeater rolls back after save
I have other repeaters in other resources using these models "Product", "ProductVariant" and it works fine. Could it be that the name "Order" cannot be used? I have no idea what is going on...
9 replies