file('file'); if( !$file || !$file->isValid()){ response()->json( ['path' => null], 400); } $path = $this->services->uploadFile( $file ); if( !$path ){ response()->json( ['path' => null], 500); } return response()->json(['path' => $path]); } }