I have to open adminhome1 view from the controller when the adminhome function is called
this is the function in the controller I tried too many things but didn't work
public function adminlogin()
{
$data = Input::all();
log::info($data);
$username = $data['username'];
$password = $data['password'];
$query = "call admin_access('$username','$password');";
$result = DB::select($query);
$result=count($result);
log::info($result);
if($result>0)
{
$this->adminhome($username);
}
else
{
return Response::json('login unsuccessful, please try appropriate username and password',200);
}
}
public function adminhome(){
log::info('we are in adminhome function');
//return Redirect::route('/adminhome1');
//return view('adminhome1');
// return Redirect::to('/adminhome1');
return redirect()->route('adminhome1');
//return View::make('/adminhome1')->with('name',$username);
// return redirect('/adminhome1');
// return view('adminhome1')->with('name', 'admin');
}
route data
Route::post('/api/adminlogin' , 'demoController@adminlogin');
Route::any('/adminhome1', function () {
return view('adminhome1');
});