All Projects → vinkla → Laravel Shield

vinkla / Laravel Shield

Licence: mit
A HTTP basic auth middleware for Laravel

Projects that are alternatives of or similar to Laravel Shield

Htmlcache
Laravel middleware to cache the rendered html
Stars: ✭ 35 (-81.87%)
Mutual labels:  middleware, laravel, composer
Jwt Auth Guard
JWT Auth Guard for Laravel and Lumen Frameworks.
Stars: ✭ 319 (+65.28%)
Mutual labels:  middleware, laravel, composer
Laravel Gitlab
A GitLab bridge for Laravel
Stars: ✭ 150 (-22.28%)
Mutual labels:  laravel, composer
Cachet
📛 An open source status page system for everyone.
Stars: ✭ 12,478 (+6365.28%)
Mutual labels:  laravel, composer
Nebula
Nebula is a minimalistic and easy to use administration tool for Laravel applications, made with Laravel, Alpine.js, and Tailwind CSS.
Stars: ✭ 190 (-1.55%)
Mutual labels:  laravel, composer
Laravel Awesome
Laravel 学习图谱
Stars: ✭ 143 (-25.91%)
Mutual labels:  laravel, composer
Has Parameters
A trait that allows you to pass arguments to Laravel middleware in a more PHP'ish way.
Stars: ✭ 149 (-22.8%)
Mutual labels:  middleware, laravel
Telegram Bot Sdk
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.
Stars: ✭ 2,212 (+1046.11%)
Mutual labels:  laravel, composer
Laravel Tinker Tools
Use short class names in an Artisan tinker session
Stars: ✭ 134 (-30.57%)
Mutual labels:  laravel, composer
Laravel Messenger
Simple user messaging package for Laravel
Stars: ✭ 2,140 (+1008.81%)
Mutual labels:  laravel, composer
Imall
基于Laravel5.2,Vue.js1.0的微信商城,用于熟悉 Laravel、Vuejs、Webpack、Gulp 的结合使用,已不维护及更新。(1MB单核基础服务器,浏览请耐心等待图片加载...)
Stars: ✭ 168 (-12.95%)
Mutual labels:  laravel, composer
Laravel Http2 Server Push
A middleware package for Laravel to enable server push for your script, style, and image assets.
Stars: ✭ 174 (-9.84%)
Mutual labels:  middleware, laravel
Laravel Paket
Composer GUI. Manage Laravel dependencies from web interface without switching to command line!
Stars: ✭ 143 (-25.91%)
Mutual labels:  laravel, composer
Laravel Authz
An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.
Stars: ✭ 136 (-29.53%)
Mutual labels:  middleware, laravel
Request Migrations
HTTP Request Migrations for API Versioning like Stripe
Stars: ✭ 149 (-22.8%)
Mutual labels:  middleware, laravel
Azuriom
Azuriom is a modern, reliable, fast and secure game CMS.
Stars: ✭ 135 (-30.05%)
Mutual labels:  laravel, composer
Laravel Ecommerce
Laravel open source e-commerce system.
Stars: ✭ 163 (-15.54%)
Mutual labels:  laravel, composer
Plus
💝The Plus (ThinkSNS+) is a powerful, easy-to-develop social system built with Laravel.
Stars: ✭ 2,148 (+1012.95%)
Mutual labels:  laravel, composer
Laravel Hashids
A Hashids bridge for Laravel
Stars: ✭ 1,714 (+788.08%)
Mutual labels:  laravel, composer
Eloquent Tree
Eloquent Tree is a tree model for Laravel Eloquent ORM.
Stars: ✭ 131 (-32.12%)
Mutual labels:  laravel, composer

shield

Laravel Shield

A HTTP basic auth middleware for Laravel.

// Use on your routes.
Route::get('/', ['middleware' => 'shield'], function () {
    // Your protected page.
});

// Use it within your controller constructor.
$this->middleware('shield');

// Use specific user credentials.
$this->middleware('shield:hasselhoff');

Build Status Monthly Downloads Latest Version

Installation

Require this package, with Composer, in the root directory of your project.

$ composer require vinkla/shield

Add the middleware to the $routeMiddleware array in your Kernel.php file.

'shield' => \Vinkla\Shield\ShieldMiddleware::class,

Configuration

Laravel Shield requires configuration. To get started, you'll need to publish all vendor assets:

$ php artisan vendor:publish

This will create a config/shield.php file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

HTTP Basic Auth Credentials

The user credentials which are used when logging in with HTTP basic authentication.

Usage

To protect your routes with the shield you can add it to the routes file.

Route::get('/', ['middleware' => 'shield'], function () {
    // Your protected page.
});

You can also add the shield middleware to your controllers constructor.

$this->middleware('shield');

The middleware accepts one optional parameter to specify which user credentials to compared with.

$this->middleware('shield:kitt');

To add a new user, you probably want to use hashed credentials. Hashed credentials can be generated with the password_hash() function in the terminal:

$ php -r "echo password_hash('my-secret-passphrase', PASSWORD_DEFAULT);"

Then copy and paste the hashed credentials to the .env environment file.

SHIELD_USER=your-hashed-user
SHIELD_PASSWORD=your-hashed-password
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].