/** * Store a new resource in storage. * * This method uses the underlying repository and can * rely on the public interface of the PhotoRepository * for creating the Photo model. This makes the API * completely ignorant of the Photo model and ensures * that the API only has to concern itself with inputs. * * @param \Illuminate\Http\Request $form data * * @return \App\Photo */ public function store(Request $form) { // Here we pass the form data from the API request // to the repository as attributes intended to be // used when creating the Photo model. return $this->repository->create($form->inputs()); }