Support the ongoing development of Laravel.io →
Session Validation

Hey guys,

Kernel.php : https://ibb.co/mHxOeQ

UserController

$this->validate($request, [
            'email' => 'required|email',
            'password' => 'required|min:3'
        ]);
return redirect('/')->with('status', 'Book was added');

View File

@if(Session::has('status'))
        <div class="alert alert-info">
            <a class="close" data-dismiss="alert">×</a>
            <strong>Heads Up!</strong> {!!Session::get('status')!!}
        </div>
    @endif

Flash and Validator don't work. How can I solve ?

Last updated 3 years ago.
0

Good Morning, usually Flash works only once, so if after the redirection there is another redirection, the flash is cleared. From you code nothing seems to be wrong, but i personnaly use the Helper instead of that facade (check if the right facade is used).

Maybe using a helper will help you https://laravel.com/docs/5.5/session#using-the-session

0

Unfortunately, it did not work. :(

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.