Answers for "how to custom message on request in laravel"

PHP
1

laravel make:request messages

public function rules()
{
    return [
        'title' => 'required|unique:posts|max:255',
        'body' => 'required',
    ];
}

public function messages()
{
    return [
        'title.required' => 'A title is required',
        'body.required' => 'A message is required',
    ];
}
Posted by: Guest on July-27-2021
0

with message in laravel

@if (\Session::has('success'))
    <div class="alert alert-success">
        <ul>
            <li>{!! \Session::get('success') !!}</li>
        </ul>
    </div>
@endif
Posted by: Guest on June-22-2021

Code answers related to "how to custom message on request in laravel"

Browse Popular Code Answers by Language