user() && $this->user()->hasPermission('upload-media'); } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return [ 'file' => 'required|file|max:10240', // Max 10MB ]; } }