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']]; }}