Пример #1
0
 /**
  * [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()];
     }
 }
Пример #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     return $this->repository->create($request->all());
 }