public function store(Request $request)
 {
     $data = $request->all();
     if (array_key_exists('file', $data)) {
         $file = $request->file('file');
         if (!$file->isValid()) {
             return Errors::basic('Problema no upload. Arquivo inválido.');
         }
         $data['file'] = $file;
     }
     return $this->service->createFile($data);
 }
 public function store(Request $request, $id)
 {
     $file = $request->file('file');
     if ($file == null) {
         return ['error' => true, 'message' => 'Nao foi selecionado Arquivo'];
     }
     $original_name = $file->getClientOriginalName();
     $original_extension = $file->getClientOriginalExtension();
     $date_upload = Carbon::now();
     $name = hash('md5', $original_name . $date_upload);
     $data['original_name'] = $original_name;
     $data['original_extension'] = $original_extension;
     $data['name'] = $name;
     $data['extension'] = $original_extension;
     $data['file'] = $file;
     $data['description'] = $request->description;
     $data['project_id'] = $id;
     return $this->service->createFile($data);
 }