public function store() { if (\Input::get('username')) { $user = new \User(); $user->username = \Input::get('username'); $user->password = \Hash::make(\Input::get('password')); $user->fname = \Input::get('fname'); $user->lname = \Input::get('lname'); $user->email = \Input::get('email'); $user->save(); } return \Redirect::to('/admin/'); }
public function register_process() { if (Input::get('username')) { $user = new \User(); $user->username = Input::get('username'); $user->password = Hash::make(Input::get('password')); $user->fname = Input::get('fname'); $user->lname = Input::get('lname'); $user->email = Input::get('email'); $user->save(); return Redirect::to('/admin'); } else { return Redirect::to('admin/register'); } }
public function getSearch(Request $request) { $searchKey = $request->get('srch-term'); //DB::connection()->enableQueryLog(); $results = User::where('type', '=', 'general')->Where(function ($query) use($searchKey) { $query->where('name', 'LIKE', '%' . $searchKey . '%')->orWhere('username', 'LIKE', '%' . $searchKey . '%'); })->paginate(2); //$queries = DB::getQueryLog(); if ($results) { return view('admin.user.index', ['users' => $results, 'result_count' => count($results), 'dataStat' => $this->userrepo->userDataStat(), 'searchKey' => $searchKey]); } else { return Redirect::back()->with('message', 'No results found'); } }
public function getPosts($idUser) { $dataUser = User::find($idUser); return viewc('admin.' . self::NAMEC . '.posts', compact('dataUser')); }