Example #1
0
 /**
  * Store a newly created groups to the database.
  *
  * @param CreateSchoolRequest $request
  * @internal param $school
  * @return Response
  */
 public function store(CreateSchoolRequest $request)
 {
     $user = $this->user();
     $group = $user->groups()->create($request->all());
     $this->clientRepo->clientJoin($group, $user);
     session()->flash('message', 'You have successfully created a new group');
     return redirect($group->username);
 }
Example #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateSchoolRequest $request)
 {
     $created = $this->school->create($request->all());
     if ($created) {
         return \Redirect::route('create_admin')->with('message', 'School successfuly set up!');
     } else {
         return \Redirect::route('create_school')->with('error-message', 'Failed to Set up school, try again!');
     }
 }
Example #3
0
 public function postCreateSchool(CreateSchoolRequest $request, $school)
 {
     $user = \Auth::user();
     $user->schools()->create($request->all());
     return redirect('/schools');
 }