mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-24 03:59:08 -05:00
(Update) Refactor HTTP Redirects
- Use global redirect() helper instead of facade
This commit is contained in:
@@ -14,7 +14,6 @@ namespace App\Http\Controllers\Staff;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
@@ -102,9 +101,9 @@ class UserController extends Controller
|
||||
// Activity Log
|
||||
\LogActivity::addToLog("Staff Member " . $staff->username . " has edited " . $user->username . " account.");
|
||||
|
||||
return Redirect::route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::success('Account Was Updated Successfully!', 'Yay!', ['options']));
|
||||
return redirect()->route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::success('Account Was Updated Successfully!', 'Yay!', ['options']));
|
||||
} else {
|
||||
return Redirect::route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::warning('Something Went Wrong!', 'Error', ['options']));
|
||||
return redirect()->route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::warning('Something Went Wrong!', 'Error', ['options']));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,9 +129,9 @@ class UserController extends Controller
|
||||
// Activity Log
|
||||
\LogActivity::addToLog("Staff Member " . $staff->username . " has edited " . $user->username . " account permissions.");
|
||||
|
||||
return Redirect::route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::success('Account Permissions Succesfully Edited', 'Yay!', ['options']));
|
||||
return redirect()->route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::success('Account Permissions Succesfully Edited', 'Yay!', ['options']));
|
||||
} else {
|
||||
return Redirect::route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::warning('Something Went Wrong!', 'Error', ['options']));
|
||||
return redirect()->route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::warning('Something Went Wrong!', 'Error', ['options']));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,9 +153,9 @@ class UserController extends Controller
|
||||
// Activity Log
|
||||
\LogActivity::addToLog("Staff Member " . $staff->username . " has changed " . $user->username . " password.");
|
||||
|
||||
return Redirect::route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::success('Account Password Was Updated Successfully!', 'Yay!', ['options']));
|
||||
return redirect()->route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::success('Account Password Was Updated Successfully!', 'Yay!', ['options']));
|
||||
} else {
|
||||
return Redirect::route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::warning('Something Went Wrong!', 'Error', ['options']));
|
||||
return redirect()->route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::warning('Something Went Wrong!', 'Error', ['options']));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user