Level 6
Does your locale in /config/app.php match the foldername xx ?
3 likes
this is my code at backend
$validator = Validator::make(
$req->all(),
[
'title' => 'required',
'url' => 'nullable',
'upload_slide' => 'required|image|mimes:jpeg,png,jpg,gif|max:2048',
]
);
return redirect()->back()
->withErrors($validator)
->withInput();
this is my code at Frontend
@if ($errors->any())
<?php
$errorMessage = '';
$i = 1;
//var_dump($errors->all());
?>
@foreach ($errors->all() as $error )
<?php $errorMessage .= $i++.': '.$error .'<br>'; ?>
@endforeach
{!! $createMessage->make($errorMessage, 'alert-danger') !!}
@endif
code above result in 1: validation.required ....etc
what is my problem ?
if i want show message i have to custom it with
$message = [
'title.required' => 'Please fill Title',
'url.required' => 'Please fill url',
'upload_slide.required' => 'Please add image to upload',
'upload_slide.mimes' => 'Extension not supported',
'upload_slide.max' => 'File is bigger than 2MB'
];
code above result in 1: Please fill Title ....etc
Does your locale in /config/app.php match the foldername xx ?
Please or to participate in this conversation.