コード例 #1
0
ファイル: UserController.php プロジェクト: Juliemae/eskwela
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $input = Request::all();
     // $student = new Students;
     // $student->school_id = $input['school_id'];
     // $student->lastname = $input['lastname'];
     // $student->firstname = $input['firstname'];
     // $student->middlename = $input['middlename'];
     // $student->password = $input['password'];
     // $student->save();
     //dd($input);
     Students::create($input);
     $user = new User();
     $user->school_id = $input['school_id'];
     $user->password = $input['password'];
     $user->status = "0";
     $user->save();
     return $input;
 }
コード例 #2
0
ファイル: Registrar.php プロジェクト: Juliemae/eskwela
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 public function create(array $data)
 {
     return Students::create(['school_id' => $data['school_id'], 'lastname' => $data['lastname'], 'firstname' => $data['firstname'], 'middlename' => $data['middlename'], 'password' => bcrypt($data['password'])]);
 }