PHPackages                             tartan/separ - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. tartan/separ

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

tartan/separ
============

A HTTP basic auth middleware for Laravel 7+

051PHPCI failing

Since Mar 18Pushed 6y agoCompare

[ Source](https://github.com/iamtartan/laravel-basic-auth)[ Packagist](https://packagist.org/packages/tartan/separ)[ RSS](/packages/tartan-separ/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Separ: Laravel 7+ basic auth component
======================================

[](#separ-laravel-7-basic-auth-component)

> Separ means Shield in English

[![separ](https://camo.githubusercontent.com/531ddbbe90d719bc8127af47cd7cbd478546073d96868f9cac86c9527c43ec76/68747470733a2f2f696d616765732e6964676573672e6e65742f696d616765732f61727469636c652f323031382f30382f375f626573742d636f6d6d6f6e2d646566656e7365735f73776f72645f736869656c645f77617272696f725f6b6e696768745f73656375726974792d3130303736383034362d6c617267652e6a7067)](https://camo.githubusercontent.com/531ddbbe90d719bc8127af47cd7cbd478546073d96868f9cac86c9527c43ec76/68747470733a2f2f696d616765732e6964676573672e6e65742f696d616765732f61727469636c652f323031382f30382f375f626573742d636f6d6d6f6e2d646566656e7365735f73776f72645f736869656c645f77617272696f725f6b6e696768745f73656375726974792d3130303736383034362d6c617267652e6a7067)

How it's working?
-----------------

[](#how-its-working)

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

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

// Use specific user credentials.
$this->middleware('MY_USERNAME:MY_SECRET_PASS');
```

Installation
------------

[](#installation)

Require this package, with [Composer](https://getcomposer.org/), in the root directory of your project.

```
$ composer require tartan/separ
```

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

```
'separ' => \Tartan\Separ\ShieldMiddleware::class,
```

Configuration
-------------

[](#configuration)

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

```
$ php artisan vendor:publish
```

This will create a `config/separ.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

[](#http-basic-auth-credentials)

The user credentials which are used when logging in with [HTTP basic authentication](https://en.m.wikipedia.org/wiki/Basic_access_authentication).

Usage
-----

[](#usage)

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

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

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

```
$this->middleware('separ');
```

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

```
$this->middleware('ANOTHER_USER:ANOTHER_PASS');
```

To add a new user, you probably want to use hashed credentials. Hashed credentials can be generated with the [`password_hash()`](https://secure.php.net/manual/en/function.password-hash.php) 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.

```
SEPAR_USER=your-hashed-user
SEPAR_PASSWORD=your-hashed-password
```

Team
----

[](#team)

This component is developed by the following person(s) and a bunch of [awesome contributors](https://github.com/iamtartan/laravel-online-payment/graphs/contributors).

[![Aboozar Ghaffari](https://avatars2.githubusercontent.com/u/502961?v=3&s=130)](https://github.com/iamtartan)[Aboozar Ghaffari](https://github.com/iamtartan)Support This Project
--------------------

[](#support-this-project)

Please contribute in package completion. This is the best support.

License
-------

[](#license)

[MIT](LICENSE) © [Aboozar Ghaffari](https://github.com/iamtartan)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9299d1f63e54a717d0b785253adc636f90c3b460ae9bd24bfc1505ef5f90f1ec?d=identicon)[tartan](/maintainers/tartan)

---

Top Contributors

[![samuraee](https://avatars.githubusercontent.com/u/502961?v=4)](https://github.com/samuraee "samuraee (4 commits)")

### Embed Badge

![Health badge](/badges/tartan-separ/health.svg)

```
[![Health](https://phpackages.com/badges/tartan-separ/health.svg)](https://phpackages.com/packages/tartan-separ)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
