public function addstudent() { $inputs = Input::all(); $addStudentResult = Students::addStudent($inputs); header('Access-Control-Allow-Origin: *'); if ($addStudentResult) { return Response::json(array("status" => "success")); } else { return Response::json(array("status" => "failed")); } }
public static function signup() { $input = Input::all(); $check = User::checkEmailAlreadyExist($input['email']); if ($check) { return Redirect::to('/students/signup')->withErrors(array("msg" => "Sorry!! This Email already Exist, please use different email.")); } else { $flag = Students::addStudent(); if ($flag) { return Redirect::to('/students/login')->withErrors(array("msg" => "Student added successfully! Please Login To continue.")); } else { return Redirect::to('/students/signup')->withErrors(array("msg" => "student Not added Succesfully, please try again.")); } } }