/**
  * Deletes a scheduling from the database.
  *
  * @param  $id - Id of the pack to be deleted
  * @return Response
  * @throws ResourceNotFoundException
  */
 public function delete($id)
 {
     $id = $this->filter->sanitize($id, 'int');
     try {
         $scheduling = Scheduling::findFirstOrFail(['id = ?0', 'bind' => [$id]]);
         return $this->response($this->request, $scheduling);
     } catch (ResourceNotFoundException $e) {
         return $e->returnResponse();
     }
 }
Пример #2
0
 public static function GenerateFake($faker)
 {
     return ['name' => $faker->sentence($nbWords = 6), 'desc' => $faker->text($maxNbChars = 200), 'photo_cover' => $faker->imageUrl($width = 640, $height = 480), 'start_date' => $faker->dateTime($min = 'now')->format('Y-m-d h:m:s'), 'end_date' => $faker->dateTime($min = 'now')->format('Y-m-d h:m:s'), 'flyer' => $faker->imageUrl($width = 640, $height = 480), 'local_id' => $faker->numberBetween($min = 1, $max = Local::count()), 'guestList_id' => $faker->optional()->numberBetween($min = 1, $max = GuestList::count()), 'scheduling_id' => $faker->optional()->numberBetween($min = 1, $max = Scheduling::count())];
 }