Reputation: 7052
I have a FormRequest class like below
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreImageRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'uploadImage' => 'image|mimes:jpg,png,jpeg,|max:2048',
];
}
}
How can I get validation message here ? Like if the file is not an Image
or the file size is not within max:2048
.
Thanks
Upvotes: 4
Views: 8648