FEATURE: use even more route model binding
This commit is contained in:
@@ -22,18 +22,14 @@ class UserDetail extends Controller
|
||||
$this->log = $log;
|
||||
}
|
||||
|
||||
public function getDetail($id = null)
|
||||
public function getDetail(User $user = null)
|
||||
{
|
||||
// when no user specified, lets assume we want to edit "me"
|
||||
if (!$id) {
|
||||
$id = Auth::user()->id;
|
||||
if (!$user->exists()) {
|
||||
$id = Auth::user();
|
||||
}
|
||||
|
||||
// try to find given user
|
||||
$user = User::findOrFail($id);
|
||||
|
||||
$actions = $this->log->getUserActions($id, 10);
|
||||
|
||||
$actions = $this->log->getUserActions($user->id, 10);
|
||||
$roles = UserRoles::getWithTranslations();
|
||||
$states = UserStates::getWithTranslations();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user