visial update on notifications

This commit is contained in:
nurmuhammet committed 2025-05-09 22:26:18 +05:00
1 parent a789a5cefa
commit 7466166167
2 files changed
+11 -6

No files matched your search

+3 -3
View File
@@ -136,7 +136,7 @@ public static function indexQuery(NovaRequest $request, mixed $query): Builder
*/
public static function afterCreate(NovaRequest $request, Model $model): void
{
LoanOrderRepo::notifyUser($request, $model, __('Loan order created'), 'success');
LoanOrderRepo::notifyUser($request, $model, __('Loan order created'), 'success', 'pencil');
}
/**
@@ -148,7 +148,7 @@ public static function afterCreate(NovaRequest $request, Model $model): void
*/
public static function afterUpdate(NovaRequest $request, Model $model): void
{
LoanOrderRepo::notifyUser($request, $model, __('Loan order updated'));
LoanOrderRepo::notifyUser($request, $model, __('Loan order updated'), 'info', 'pencil-alt');
}
/**
@@ -160,7 +160,7 @@ public static function afterUpdate(NovaRequest $request, Model $model): void
*/
public static function afterDelete(NovaRequest $request, Model $model): void
{
LoanOrderRepo::notifyUser($request, $model, __('Loan order deleted'));
LoanOrderRepo::notifyUser($request, $model, __('Loan order deleted'), 'error', 'trash');
}
/**
+8 -3
View File
@@ -60,8 +60,13 @@ public static function generateUniqueId(mixed $model): string
);
}
public static function notifyUser(NovaRequest $request, Model $model, string $message, string $type = 'info'): void
{
public static function notifyUser(
NovaRequest $request,
Model $model,
string $message,
string $type = 'info',
string $icon = 'eye',
): void {
/** @var \App\Models\Order\Loan\LoanOrder */
$loanOrder = $model;
@@ -74,7 +79,7 @@ public static function notifyUser(NovaRequest $request, Model $model, string $me
NovaNotification::make()
->message($message.': '.$loanOrder->unique_id)
->action(__('See'), URL::remote($url))
->icon('cash')
->icon($icon)
->type($type)
);
}