collection = Collection::where('name',$this->collection_name)->get(); } /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } private function getExts() { return implode(",",$this->collection->exts); } private function getMimeTypes() { return implode(",",$this->collection->mimetypes); } // private function getExt() // { // return implode(",",$this->collection->ext); // } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ "ext" => ["mimes:" . $this->getExts], "memetype" => ["mimetypes:" . $this->getMimeTypes], "width"=> [''], "height"=> [''], "file_size"=> [''], ]; } }