sven / super-basic-auth
A lightweight package to add basic authentication to your Laravel app.
Installs: 1 058
Dependents: 0
Suggesters: 0
Security: 0
Stars: 23
Watchers: 3
Forks: 2
Open Issues: 2
Requires
- php: ^8.1
- laravel/framework: ^9.0 || ^10.0
Requires (Dev)
- orchestra/testbench: ^7.0 || ^8.0
This package is auto-updated.
Last update: 2024-10-28 10:33:50 UTC
README
Super Basic Auth
This is a super lightweight package to add the most basic form of authentication to your Laravel app. All you need is a webserver and a text editor!
Installation
The installation instructions for this package can be found below.
Downloading
Via composer:
$ composer require sven/super-basic-auth
Or add the package to your dependencies in composer.json
and run
composer update
on the command line to download it:
{ "require": { "sven/super-basic-auth": "^2.3" } }
Usage
To use this package, first add the following code to your config/auth.php
file:
return [ // ... 'basic' => [ 'user' => env('AUTH_USERNAME'), 'password' => env('AUTH_PASSWORD'), ], ];
Be sure to add AUTH_USERNAME
and AUTH_PASSWORD
to your .env
file. You can
call these entries whatever you want.
Finally, apply the middleware to any route you want protected by those credentials:
Route::group('admin', function () { // Your password protected routes. })->middleware(\Sven\SuperBasicAuth\SuperBasicAuth::class);
Contributing
All contributions (pull requests, issues and feature requests) are welcome. Make sure to read through the CONTRIBUTING.md first, though. See the contributors page for all contributors.
License
sven/super-basic-auth
is licensed under the MIT License (MIT). Please see the
license file for more information.