public function store(Request $request)
 {
     try {
         $this->checkPermissions($request->project_id);
         return $this->service->create($request->all());
     } catch (\Exception $e) {
         return ['error' => $e->getMessage()];
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     try {
         return $this->service->create($request->all());
     } catch (NoActiveAccessTokenException $e) {
         return $this->erroMsgm('Usuário não está logado.');
     } catch (ValidatorException $e) {
         $error = $e->getMessageBag();
         return ['error' => true, 'message' => "Erro ao cadastrar o projeto, alguns campos são obrigatórios!", 'messages' => $error->getMessages()];
     } catch (\Exception $e) {
         return $this->erroMsgm('Ocorreu um erro ao cadastrar o projeto.');
     }
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create(Request $request)
 {
     //dd($request->all());
     return $this->service->create($request->all());
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     return $this->service->create($request->all());
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request $request
  * @return Response
  */
 public function store(Request $request, $projectId)
 {
     $data = ['file' => $request->file('file'), 'extension' => $request->file('file')->getClientOriginalExtension(), 'name' => $request->name, 'description' => $request->description, 'project_id' => $projectId];
     return $this->service->create($data);
 }