mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-02-11 14:09:31 -06:00
refactor: swap magic RedirectResponse withX('Y') to with('X', 'Y')
Allows ctrl+clicking to access the underlying function unlike the previous magic implementation. Probably also negligibly faster.
Swapped all instances of `>withSuccess(` -> `>with('success', `, `>withWarning(` -> `>with('warning', `, and `>withInfo(` -> `>with('info', ` with ide's find and replace.
This commit is contained in:
@@ -47,7 +47,7 @@ class NotificationController extends Controller
|
||||
$notification->markAsRead();
|
||||
|
||||
return redirect()->to($notification->data['url'])
|
||||
->withSuccess(trans('notification.marked-read'));
|
||||
->with('success', trans('notification.marked-read'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,7 +60,7 @@ class NotificationController extends Controller
|
||||
$notification->markAsRead();
|
||||
|
||||
return to_route('users.notifications.index', ['user' => $user])
|
||||
->withSuccess(trans('notification.marked-read'));
|
||||
->with('success', trans('notification.marked-read'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,7 +75,7 @@ class NotificationController extends Controller
|
||||
$user->unreadNotifications()->update(['read_at' => now()]);
|
||||
|
||||
return to_route('users.notifications.index', ['user' => $user])
|
||||
->withSuccess(trans('notification.all-marked-read'));
|
||||
->with('success', trans('notification.all-marked-read'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,7 +88,7 @@ class NotificationController extends Controller
|
||||
$notification->delete();
|
||||
|
||||
return to_route('users.notifications.index', ['user' => $user])
|
||||
->withSuccess(trans('notification.deleted'));
|
||||
->with('success', trans('notification.deleted'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,6 +101,6 @@ class NotificationController extends Controller
|
||||
$user->notifications()->delete();
|
||||
|
||||
return to_route('users.notifications.index', ['user' => $user])
|
||||
->withSuccess(trans('notification.all-deleted'));
|
||||
->with('success', trans('notification.all-deleted'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user