###Form Request (Validation)
class Update extends FormRequest {
public function rules()
{
return [
... whatever
];
}
}
###Controller
public function update(UpdateRequest $request)
{
$this->execute(UpdateEventCommand::class, $request->all());
$this->flash->message('paragraphs.event-updated');
return back();
}
###Command
class UpdateEventCommand extends SelfHandlingCommand {
public $id,
$user,
$client_id,
$office_room_id,
$title,
$description,
$start,
$end,
$updated_start,
$updated_end,
$full,
$color;
public function handle(EventRepository $repository)
{
return $repository->updateEvent($this->getPublicProperties());
}
}