charleswilfriedk
Notification send before observer creating function is executed
Hello everyone!
I have an observer on my model to make un order number during the creating event, but the notification which is suppose to include the order number is send without it (i suppose that the order number is not yet ready when the notification is send)
Does anyone have any idea how to correct this behaviour ?
25 replies
Summarize Sum of a calculated field
Hi! I'm trying to show the sum of a calculated attribute.
I have a Transaction model which has many Products. The pivot table has the quantity and the unit price for the product.
So i have the attribute amount which is calculated and appended to the transaction.
I can display the amount on my table with TextColumn('amount'), but when i try to add the summary i get a error that transactions.amount is not a field in the DB.
So my question is how do i make it use the eloquent model instead of a DB query?
5 replies
How to send a success notification after a custom action ?
Hello, i'm trying to send a notification after a custom action but no notification get fired.
My code :
Action::make('reset_user_password')
->action(
fn (User $record) => $this->resetPassword($record)
)
->requiresConfirmation()
->successNotification(
Notification::make()
->success()
->title('User password reset!'),
);
17 replies
Display user avatar with ImageColumn
I want to display the avatar for my users.
I added HasAvatars to the User model and all but ImageColumn::make('avatar_url') returns nothing.
It's supposed to return the generated ui-avatars if the avatar_url is null right ?
I'm lost.
10 replies
How to add $record and $ownerRecord in a relation manager notification
Hi everyone!
I'm trying to add the record and the owner record name in the success notification on the create action.
This is what i tried but it's not working.
Notification::make()->success()
->title( fn (RelationManager $livewire, Model $record) => "{$record->name} successfully added to {$livewire->ownerRecord->name}." )
19 replies