• 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

Fetch files from next cloud storage and display in Laravel website

Implode array with array of glue strings

php script to delete files older than 24 hrs, deletes all files

PHP: Print caught exception like Xdebug

Attempted to call an undefined method named "get" of class "MailController"

Laravel dosen't connect with Oracle

Laravel 8 factory state afterCreating

Split comma separated value from table column into rows using mysql?

woocommerce change position of price

500 Internal Server Error on Ajax request. Not sure the origin of the problem

PHPExcel_IOFactory::createWriter causes wrong behaviour

PHP: How to quickly split a key=value file into associative array

Cache clear probem in Larave

GRPC installed successfully on ubuntu but php is looking for it in another folder

MySQL - Connection failed: No route to host

About Contact Privacy policy Terms and conditions