PHPackages                             exodusanto/laravel-concierge - 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. exodusanto/laravel-concierge

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

exodusanto/laravel-concierge
============================

Api token authentication for laravel projects

v0.6.0(3y ago)32.6kMITPHPPHP ^7.3|^8.0CI failing

Since Jan 26Pushed 3y ago2 watchersCompare

[ Source](https://github.com/exodusanto/laravel-concierge)[ Packagist](https://packagist.org/packages/exodusanto/laravel-concierge)[ Docs](https://github.com/exodusanto/laravel-concierge)[ RSS](/packages/exodusanto-laravel-concierge/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (9)Dependencies (4)Versions (13)Used By (0)

Laravel concierge
=================

[](#laravel-concierge)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b86373d5361f4f97b94b30a3cb24492220018c1d2e0fb2e3bcb317fcb531e720/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65786f647573616e746f2f6c61726176656c2d636f6e6369657267652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/exodusanto/laravel-concierge)[![Build Status](https://camo.githubusercontent.com/896e49fb955f7cbcaebd25e2e315baa3f96bb8d709cf6eca5528226742cd998a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f65786f647573616e746f2f6c61726176656c2d636f6e6369657267652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/exodusanto/laravel-concierge)[![Total Downloads](https://camo.githubusercontent.com/ab64a8e831db4664440dd87bd83498daf62c7734e916d62131424d8cf2632cee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f65786f647573616e746f2f6c61726176656c2d636f6e6369657267652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/exodusanto/laravel-concierge)

Extend the [base solution](https://laravel.com/docs/6.x/api-authentication) from Laravel with some new features

- Auto refresh user token on `GET` requests
- Refresh/Revoke methods
- Blade directive

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

[](#installation)

You can install the package via composer:

```
composer require exodusanto/laravel-concierge
```

Usage
-----

[](#usage)

### 1. Migration

[](#1-migration)

Migrate your user table with `api_token` and `api_token_refreshed_at`.

```
Schema::table('users', function (Blueprint $table) {
    $table->string('api_token')->nullable();
    $table->timestamp('api_token_refreshed_at')->nullable();
});
```

#### api\_token\_refreshed\_at

[](#api_token_refreshed_at)

This attribute is use to store the timestamp of `api_token` update

### 2. Model

[](#2-model)

Add `RefreshApiToken` trait and `RefreshApiTokenContract` contract to your model

```
class User extends BaseUser implements RefreshApiTokenContract
{
    use RefreshApiToken;
}
```

### 3. Config

[](#3-config)

Publish concierge config

```
php artisan vendor:publish --tag=concierge-config
```

Use the same key to identify the right model in `auth.providers` and `concierge.tokens_lifetime`

```
// config/auth.php
'providers' => [
    'users' => [
        'driver' => 'eloquent',
        'model' => App\User::class,
    ],
]

// config/concierge.php
'tokens_lifetime' => [
    'users' => 10800 // 3h
]
```

### 4. Middleware

[](#4-middleware)

Append `RefreshApiToken` to your application `web` middleware group

```
// app/Http/Kernel.php
protected $middlewareGroups = [
    'web' => [
        ...
        \Exodusanto\Concierge\Http\Middleware\RefreshApiToken::class,
    ],
```

### @Concierge

[](#concierge)

Concierge is shipped with a custom Blade directive, it will render the token of the authenticated user

```
@concierge

    __CONCIERGE__ = { "api_token": "XXXXXXXXXXXX" }

```

#### @Concierge options

[](#concierge-options)

`@concierge($guard, $attributeName)`

```
@concierge('other_guard', 'my_token')

    __CONCIERGE__ = { "my_token": "XXXXXXXXXXXX" }

```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Antonio Dal Sie](https://github.com/exodusanto)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~98 days

Recently: every ~245 days

Total

11

Last Release

1358d ago

PHP version history (2 changes)v0.1.0PHP ^7.2

v0.6.0PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c29636a30f4dc41511ca4e8ed53c4a19eb5e64c6cb367ecc583282aa7985e58e?d=identicon)[exodusanto](/maintainers/exodusanto)

---

Top Contributors

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

---

Tags

exodusantolaravel-concierge

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/exodusanto-laravel-concierge/health.svg)

```
[![Health](https://phpackages.com/badges/exodusanto-laravel-concierge/health.svg)](https://phpackages.com/packages/exodusanto-laravel-concierge)
```

###  Alternatives

[directorytree/ldaprecord-laravel

LDAP Authentication &amp; Management for Laravel.

5742.2M17](/packages/directorytree-ldaprecord-laravel)[illuminate/auth

The Illuminate Auth package.

9327.9M1.2k](/packages/illuminate-auth)[venturedrake/laravel-crm

A free open source CRM built as a package for laravel projects

42010.0k](/packages/venturedrake-laravel-crm)

PHPackages © 2026

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