https://dev.to/moose_said I'm currently working on a major side project that takes up practically all of my free time.

Exit fullscreen mode routes 2- Routes: In routes/web.php file, we're using the ImageUploadController@store to handle post requests to this route.

public function rules() { return [ 'images' => ['bail', 'required'], 'images.*' => ['bail', 'image', 'mimes:jpeg,jpg,png,gif,webp']]; }

Now we can use our Validation rule by importing it to whatever place we're using for validation, in my case StoreImagesRequest.php */ public function rules() { return [ 'images' => ['bail', 'required', new Maxsize], 'images.*' => ['bail', 'image', 'mimes:jpeg,jpg,png,gif,webp']]; }}
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners