Search
 
SCRIPT & CODE EXAMPLE
 

PHP

flash message laravel for incorrect password

public function login(Request $request)
    {
        //Error messages
        $messages = [
            "email.required" => "Email is required",
            "email.email" => "Email is not valid",
            "email.exists" => "Email doesn't exists",
            "password.required" => "Password is required",
            "password.min" => "Password must be at least 6 characters"
        ];
        
        // validate the form data
        $validator = Validator::make($request->all(), [
                'email' => 'required|email|exists:users,email',
                'password' => 'required|min:6'
            ], $messages);
    
        if ($validator->fails()) {
            return back()->withErrors($validator)->withInput();
        } else {
            // attempt to log
            if (Auth::attempt(['approve' => '1', 'email' => $request->email, 'password' => $request->password ], $request->remember)) {
                // if successful -> redirect forward
                return redirect()->intended(route('user.overview'));
            }
    
            // if unsuccessful -> redirect back
            return redirect()->back()->withInput($request->only('email', 'remember'))->withErrors([
                'approve' => 'Wrong password or this account not approved yet.',
            ]);
        }
    }
Comment

PREVIOUS NEXT
Code Example
Php :: laravel Call to a member function validate() on array 
Php :: php artisan migrate stuck 
Php :: auto complete order 
Php :: laravel scheduler every 10 minutes 
Php :: findOneBy 
Php :: php artisan vendor:publish --provider="SpatieActivitylogActivitylogServiceProvider" --tag="activitylog-migrations" 
Php :: cookie phpsessid will be soon treated as cross-site cookie against 
Php :: seguridad de las api en laravel 
Php :: elvis operator php 
Php :: how to calculate position of student in class in laravel 
Php :: Filtrer les articles WordPress mis en avant 
Php :: php run server laravel 
Php :: Laravel group collection and sort by the biggest value 
Php :: through error on warning php 
Php :: laravel 7 factory tinker 
Php :: how to get session variables from cookie string 
Php :: how to put cloth on 3d model using javascript and php 
Php :: how to select specific id in laravel using isset 
Php :: wordpress widget categories edit 
Php :: $s = [1,2,3] for loop use in php 
Php :: filter from taggable laravel 
Php :: how can we send attached file with notification in gmail in laravel 8 
Php :: Create mocking dependency in unit test Laravel 
Php :: how to put external file in laravel listener class 
Php :: send email to no register user in laravel 
Php :: upsert request php-salesforce-rest-api 
Php :: preg_replace encoding 
Php :: Detecting specifically the My account "Dashboard" page 
Php :: objeto php em sessão 
Php :: php async curl request 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =