mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-23 11:39:19 -05:00
refactor: preslash simple functions
- Add pre-slash to short named functions to improve performance by almost 30% - @see https://stackoverflow.com/questions/55419673/php7-adding-a-slash-to-all-standard-php-functions-php-cs-fixer-rule
This commit is contained in:
@@ -30,7 +30,7 @@ class NotificationController extends Controller
|
||||
{
|
||||
$notifications = $request->user()->notifications()->paginate(25);
|
||||
|
||||
return view('notification.index', ['notifications' => $notifications]);
|
||||
return \view('notification.index', ['notifications' => $notifications]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,7 +126,7 @@ class NotificationController extends Controller
|
||||
|
||||
$notifications = $notification->paginate(25);
|
||||
|
||||
return view('notification.results', [
|
||||
return \view('notification.results', [
|
||||
'user' => $user,
|
||||
'notifications' => $notifications,
|
||||
])->render();
|
||||
@@ -145,7 +145,7 @@ class NotificationController extends Controller
|
||||
$notification = $request->user()->notifications()->findOrFail($id);
|
||||
$notification->markAsRead();
|
||||
|
||||
return redirect()->to($notification->data['url'])
|
||||
return \redirect()->to($notification->data['url'])
|
||||
->withSuccess('Notification Marked As Read!');
|
||||
}
|
||||
|
||||
@@ -162,18 +162,18 @@ class NotificationController extends Controller
|
||||
$notification = $request->user()->notifications()->where('id', '=', $id)->first();
|
||||
|
||||
if (! $notification) {
|
||||
return redirect()->route('notifications.index')
|
||||
return \redirect()->route('notifications.index')
|
||||
->withErrors('Notification Does Not Exist!');
|
||||
}
|
||||
|
||||
if ($notification->read_at != null) {
|
||||
return redirect()->route('notifications.index')
|
||||
return \redirect()->route('notifications.index')
|
||||
->withErrors('Notification Already Marked As Read!');
|
||||
}
|
||||
|
||||
$notification->markAsRead();
|
||||
|
||||
return redirect()->route('notifications.index')
|
||||
return \redirect()->route('notifications.index')
|
||||
->withSuccess('Notification Marked As Read!');
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ class NotificationController extends Controller
|
||||
$carbon = new Carbon();
|
||||
$request->user()->unreadNotifications()->update(['read_at' => $carbon]);
|
||||
|
||||
return redirect()->route('notifications.index')
|
||||
return \redirect()->route('notifications.index')
|
||||
->withSuccess('All Notifications Marked As Read!');
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ class NotificationController extends Controller
|
||||
{
|
||||
$request->user()->notifications()->findOrFail($id)->delete();
|
||||
|
||||
return redirect()->route('notifications.index')
|
||||
return \redirect()->route('notifications.index')
|
||||
->withSuccess('Notification Deleted!');
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ class NotificationController extends Controller
|
||||
{
|
||||
$request->user()->notifications()->delete();
|
||||
|
||||
return redirect()->route('notifications.index')
|
||||
return \redirect()->route('notifications.index')
|
||||
->withSuccess('All Notifications Deleted!');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user