Answers for "laravel validation true in controller"

PHP
2

laravel validation show

<!-- /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 -->
Posted by: Guest on August-22-2020
-1

sometimes validation in laravel

Docs don't make it clear, But removing required makes it work.

$this->validate($request, [
    'password' => 'sometimes|min:8',
]);
Posted by: Guest on March-12-2021

Code answers related to "laravel validation true in controller"

Browse Popular Code Answers by Language