/** * Show the application dashboard to the user. * * @return Response */ public function index() { $userCount = User::where('id', '>=', 1)->count(); $memberCount = Member::where('id', '>=', 1)->count(); $charCount = Character::where('id', '>=', 1)->count(); $data = ['user' => Auth::user(), 'sitename' => \Config::get('diablo.sitename'), 'dashboard' => ['counters' => ['users' => ['title' => 'Users', 'value' => $userCount, 'url' => ''], 'members' => ['title' => 'Members', 'value' => $memberCount, 'url' => ''], 'characters' => ['title' => 'Characters', 'value' => $charCount, 'url' => '']]]]; return view('admin/index', $data); }
/** * Get the user id. * @return integer */ public function getUserId() { /* Get list of users */ $users = User::all(); $userData = $this->buildUserTable($users); $this->table(['id', 'username'], $userData); $user_id = $this->ask('Which user would you like to assign a role for? [1,2,...]'); return (int) $user_id; }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ public function create(array $data) { return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); }