• 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

How to make Canonicals with PHP

How do I enable error reporting in Laravel?

Laravel Pagination links() not working

MySQL order by field in Eloquent

xdebug 3 not working in ubuntu 20.04 with docker

RabbitMQ PRECONDITION_FAILED - unknown delivery tag

How to show selected value using javascript in laravel

SlimExceptionHttpNotFoundException

Add customer email and phone in "Order" column to admin orders list on Woocommerce

Laravel - Implicit route model binding with soft deleted data

WHM Enabling mod_rewrite

php curl_exec() Connection refused when retrieving a remote image

Toggle between a textbox and a select using PHP

500 (Internal Server Error) with Laravel & Docker [duplicate]

renameColumn migration fails for existing column with columns does not exist error

About Contact Privacy policy Terms and conditions