Closed yajra closed 5 years ago
I didn't quite understand how to use this function, now I have to add two uploads, one for PDFs and one for images, even if I see the upload form when I try to upload it gives me this error "A server error occurred while uploading the file"
public function createRules(): array
{
return [
'categoria' => 'required',
'title' => 'required',
'description' => 'required',
'file' =>'required|mimes:pdf,xlx,xlsx,xls,csv,txt|max:10048',
'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048'
];
}
->editors([
Editor::make()
->fields([
Fields\Text::make('categoria')->label('Fornitore'),
Fields\Text::make('title')->label('Nome'),
Fields\Text::make('description')->label('Anno'),
Fields\File::make('file_path')->label('Listino')->type('upload'),
Fields\Image::make('image_path')->label('Formato')->type('upload'),
]),
])
Where am I doing wrong?
upload
anduploadMany
.createMessages()
,editMessages()
,removeMessages()
and refactor it to one methodmessages()
.