예제 #1
0
 /**
  * @param \HorseStories\Models\Horses\Horse $horse
  * @param array $values
  */
 public function create(Horse $horse, array $values)
 {
     $values = $this->statusCreator->createForPalmares($horse, $values);
     $event = $this->eventCreator->create($values);
     $palmares = new Palmares();
     $palmares->horse_id = $horse->id;
     $palmares->discipline = $values['discipline'];
     $palmares->level = $values['level'];
     $palmares->ranking = $values['ranking'];
     $palmares->date = DateTime::createFromFormat('d/m/Y', $values['date']);
     $palmares->status_id = $values['status']->id;
     $palmares->event_id = $event->id;
     $palmares->save();
 }
예제 #2
0
 /**
  * @param \HorseStories\Http\Requests\PostStatus $request
  * @return string
  */
 public function store(PostStatus $request)
 {
     $this->statusCreator->create($request->all());
     Session::put('success', 'Status has been posted');
     return redirect()->refresh();
 }