• 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

Server-sent events in PHP (without echo or print)

CONCAT columns with Laravel 5 eloquent

Is there a way to use Foundry Model for Authentification inside Functional Tests?

Cannot connect to own websocket server when on secured domain

phpunit - testing is painfully slow

Laravel relationship belongsToMany with composite primary keys

Google API Heatmap Layer exception, why?

Docker & Laravel : configure: error: Package requirements (oniguruma) were not met

PHP's array_map including keys

Prestashop webservice API creating cart rules

php echo remove slashes from url [duplicate]

find in set in laravel ? example

Destroy session upon refresh

How to use $this->session->set_userdata in codeigniter

How to delete old images from public folder on update using Laravel

About Contact Privacy policy Terms and conditions