Laravel comes with this validation message that shows file size in kilobytes:
file' => 'The :attribute may not be greater than :max kilobytes.',
I want to customize it in a way that it shows megabytes instead of kilobytes. So for the user it would look like:
"The document may not be greater than 10 megabytes."
How can I do that?
We might be on different page, here is what I am trying to say. I hope this helps. Cheers!
public function rules()
{
return [
'file' => 'max:10240',
];
}
public function messages()
{
return [
'file.max' => 'The document may not be greater than 10 megabytes'
];
}