This commit moves list of user roles into separate class (with own namespace), so we can access this data anywhere from application.
27 lines
641 B
PHP
27 lines
641 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
use App\Enumerations\UserRoles;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests;
|
|
use App\Models\User;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class UserDetail extends Controller
|
|
{
|
|
public function getDetail($id = null)
|
|
{
|
|
// when no user specified, lets assume we want to edit "me"
|
|
if (!$id) {
|
|
$id = Auth::user()->id;
|
|
}
|
|
|
|
// try to find given user
|
|
$user = User::findOrFail($id);
|
|
|
|
$roles = UserRoles::getWithTranslations();
|
|
|
|
return view('admin.userManagement.detail', ['user' => $user, 'roles' => $roles]);
|
|
}
|
|
} |