Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

return message in laravel


create validation errors 
<!-- /resources/views/post/create.blade.php -->

<h1>Create Post</h1>

@if ($errors->any())
    <div class="alert alert-danger">
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif

<!-- Create Post Form -->








##error message:
<!-- /resources/views/post/create.blade.php -->

<label for="title">Post Title</label>

<input id="title" type="text" name="title" class="@error('title') is-invalid @enderror">

@error('title')
    <div class="alert alert-danger">{{ $message }}</div>
@enderror
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #return #message #laravel
ADD COMMENT
Topic
Name
9+1 =