• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to create custom authentication in laravel 8?

phplaravel


PHP Snippet 1:

protected function validateLogin(Request $request)
{
    $request->validate([
        $this->username() => 'required|string',
        'password' => 'required|string',
    ]);
}

protected function credentials(Request $request)
{
    return $request->only($this->username(), 'password');
}

//Mention your username here
public function username()
{
    return 'user_name';
}

Related Snippets

Detect if PHP session exists

How to override htaccees file for cache control header

Undefined variable in Laravel 8 project (php 7.4)

Can we define variables in `.tpl` files?

How to validate Envato Purchase Code in PHP

xdebug 3 not working in ubuntu 20.04 with docker

Laravel relationship belongsToMany with composite primary keys

Unable to run composer install

Laravel - How to properly generate unique slugs from article titles?

PDOException SQLSTATE[HY000] [2002] No such file or directory

Laravel Nova Dependency Container what are the allowed resource properties other than id in dependsOn

PHP and WebView - Cookie doesn't are the same

How to pass data to all views in Laravel 5?

how to insert data into select2 search input after scan using qrcode

PHP array sort and remove duplicates by two field values

About Contact Privacy policy Terms and conditions