4 years ago

$errors variable not available

Posted 4 years ago by myrdsrn

I have installed a new Laravel app and started building a sign-up page and it works fine.

When I go to add the $errors variable to the sign-up page I get the following message.

ErrorException in 6ce283a7bf63c51257885c3e94e0e0d7 line 12:
Undefined variable: errors (View: /var/www/

I have used the example from the Validation docs.

@if (count($errors) > 0)
    <div class="alert alert-danger">
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>

When I comment out the above block everything works.

From my understanding of the docs, "$errors variable will always be available in all of your views on every request" .

Have I done something wrong?

Please sign in or create an account to participate in this conversation.