Beispiel #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(DirectorFormRequest $request)
 {
     // Save new director
     Director::create($request->all());
     flash()->success('New director has been added!');
     return redirect('directors');
 }
 public function run()
 {
     // TestDummy::times(20)->create('App\Post');
     Director::create(['title' => 'Fr.', 'firstname' => 'Ron', 'lastname' => 'Boudreaux', 'suffix' => 'S.J.', 'address' => 'Montserrat Retreat House', 'address2' => '600 N. Shady Shores Road', 'city' => 'Lake Dallas', 'state' => 'TX', 'zip' => '75065', 'country' => 'USA', 'homephone' => '940-321-6020 x237', 'workphone' => '940-321-6020 x237', 'mobilephone' => '940-395-7447', 'gender' => 'Male', 'languages' => 'English, Spanish', 'email' => '*****@*****.**', 'password' => bcrypt('admin')]);
     Director::create(['title' => 'Fr.', 'firstname' => 'Anthony', 'lastname' => 'Borrow', 'suffix' => 'S.J.', 'address' => 'Montserrat Retreat House', 'address2' => '600 N. Shady Shores Road', 'city' => 'Lake Dallas', 'state' => 'TX', 'zip' => '75065', 'country' => 'USA', 'homephone' => '940-321-6020 x233', 'workphone' => '940-321-6020 x233', 'mobilephone' => '504-383-5852', 'url' => 'https://arborrow.org', 'gender' => 'Male', 'languages' => 'English/Spanish', 'email' => '*****@*****.**', 'password' => bcrypt('admin')]);
     Director::create(['title' => 'Fr.', 'firstname' => 'John', 'lastname' => 'Payne', 'suffix' => 'S.J.', 'address' => 'Montserrat Retreat House', 'address2' => '600 N. Shady Shores Road', 'city' => 'Lake Dallas', 'state' => 'TX', 'zip' => '75065', 'country' => 'USA', 'homephone' => '940-321-6020 x229', 'workphone' => '940-321-6020 x229', 'mobilephone' => '512-289-3370', 'gender' => 'Male', 'languages' => 'English', 'email' => '*****@*****.**', 'password' => bcrypt('admin')]);
 }
Beispiel #3
0
 private function checkDirectors($directors)
 {
     $user = Auth::user();
     $currentDirectors = array_filter($directors, 'is_numeric');
     $newDirectors = array_diff($directors, $currentDirectors);
     foreach ($newDirectors as $newDirector) {
         $director = Director::create(['name' => $newDirector]);
         $user->directors()->save($director);
         $currentDirectors[] = $director->id;
     }
     return $currentDirectors;
 }