Looking to hire Laravel developers? Try LaraJobs

laravel-basic-auth maintained by vdhoangson

Description
The Laravel Basic Auth.
Author
Last update
2025/06/04 04:58 (dev-main)
License
Links
Downloads
34

Comments
comments powered by Disqus

Laravel Basic Auth

GitHub tag (latest by date) GitHub Packagist

Installation

You can install this package by composer:

composer require vdhoangson/laravel-basic-auth

Implementation

Use this in routes/web.php

Route::middleware(['basic-auth'])->group(function () {
    //All the routes are placed in here
    Route::get('/home', 'DashboardController@dashboard');
});

OR

Route::get('/home', 'DashboardController@dashboard')->middleware('basic-auth');

Configures

BASIC_AUTH_USERNAME=
BASIC_AUTH_PASSWORD=
BASIC_AUTH_REALM=