function checkOrganization($name)
 {
     $organization = Organization::OfName($name)->first();
     if (empty($organization)) {
         throw new Exception("Organization doesnt exists");
     }
 }
Beispiel #2
0
 function register($input)
 {
     foreach ($input as $key => $value) {
         $this->checkEmpty($key, $value);
     }
     $user = User::create(['first_name' => $input['first_name'], 'last_name' => $input['last_name'], 'email' => $input['email'], 'password' => Hash::make($input['password'])]);
     $organization = Organization::OfName($input['organization_name'])->first();
     Member::create(['user_id' => $user->id, 'organization_id' => $organization->id]);
 }