/** * [create description] * @param array $data [description] * @return [type] [description] */ public function create(array $data) { try { $this->validator->with($data)->passesOrFail(); return $this->repository->create($data); } catch (ValidatorException $e) { return ['error' => true, 'message' => $e->getMessageBag()]; } }
/** * Store a newly created resource in storage. * * @param Request $request * @return Response */ public function store(Request $request) { return $this->repository->create($request->all()); }