Skip to content

Instantly share code, notes, and snippets.

@zabaala
Last active January 26, 2018 11:28
Show Gist options
  • Select an option

  • Save zabaala/c6a401afd8d8d21ae803e4f644f2e1d2 to your computer and use it in GitHub Desktop.

Select an option

Save zabaala/c6a401afd8d8d21ae803e4f644f2e1d2 to your computer and use it in GitHub Desktop.
<?php
// ...
class DoctorsController extends Controller
{
public function store(Request $request)
{
try {
$command = new CreateNewDoctorCommand($request->all());
$command->handle();
} catch (CommandException $commandException) {
return redirect()->back()->with('errors', $commandException->getError())->withInput();
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment