/** * Show the profile for the given user. * * @param int $id * @return Response */ public function listDashboard() { $page_title = "Dashboard"; $title = "Admin - Dashboard"; $m_articles = m_articles::all(); $count_art = number_format($m_articles->count()); $m_user = m_user::all(); $count_user = number_format($m_user->count()); $m_gallery = m_gallery::all(); $count_gallery = number_format($m_gallery->count()); return view('backend.formdashboard', ['title' => $title, 'page_title' => $page_title, 'count_art' => $count_art, 'count_user' => $count_user, 'count_gallery' => $count_gallery]); }
public function authUser(Request $request) { $validator = Validator::make($request->all(), ['txt_userid' => 'required', 'txt_pass' => 'required']); $validator->setAttributeNames($this->niceNames); if ($validator->fails()) { return redirect('user/loginUser')->withErrors($validator)->withInput(); } $user = array('usrid' => Input::get('txt_userid'), 'password' => Input::get('txt_pass'), 'status' => 1); if (Auth::attempt($user)) { //Fill session data $usrid = Input::get('txt_userid'); $users = m_user::find($usrid); Session::put('usrid', $usrid); Session::put('usrfoto', $users->foto); return Redirect::to('/user/'); } return Redirect::to('user/loginUser')->with('error', 'Could not log in, please check your username and password'); }