PHPackages                             axolote-source/authxolote-sdk - 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. axolote-source/authxolote-sdk

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

axolote-source/authxolote-sdk
=============================

Authxolote SDK

v1.0.2(2mo ago)19MITPHPPHP ^8.2|^8.3|^8.4

Since Feb 13Pushed 1mo agoCompare

[ Source](https://github.com/AxoloteSource/authxolote-sdk)[ Packagist](https://packagist.org/packages/axolote-source/authxolote-sdk)[ RSS](/packages/axolote-source-authxolote-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (4)Used By (0)

Authxolote SDK
==============

[](#authxolote-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/69ce5b1f503b352d7a8fad6e7803c8a9f45d2b2acb19abba9c0ca0f5a338552b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61786f6c6f74652d736f757263652f61757468786f6c6f74652d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/axolote-source/authxolote-sdk)[![Total Downloads](https://camo.githubusercontent.com/ea10a4e4d3d95f11f6d62929f8479d68897f5f94400647a88ff41241381e86af/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61786f6c6f74652d736f757263652f61757468786f6c6f74652d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/axolote-source/authxolote-sdk)

Authxolote SDK is a Laravel library designed to seamlessly integrate your application with the Authxolote authentication and authorization service.

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

[](#installation)

You can install the package via composer:

```
composer require axolote-source/authxolote-sdk
```

The service provider will automatically register itself.

### Configuration

[](#configuration)

Publish the configuration file using the following command:

```
php artisan vendor:publish --tag="authxolote-config"
```

This will create a `config/authxolote.php` file where you can configure:

- `url`: The Authxolote API base URL.
- `token`: Your application's authentication token.
- `cache`: Enable or disable caching for user data.
- `sync_user`: Whether to look up users in your local database or use API data directly.

You can also use environment variables in your `.env` file:

```
AUTHXOLOTE_URL=https://api.your-service.com
AUTHXOLOTE_TOKEN=your-app-token
AUTHXOLOTE_CACHE=true
AUTHXOLOTE_SYNC_USER=true
```

Setup Authentication
--------------------

[](#setup-authentication)

To use the Authxolote guard, add it to your `config/auth.php`:

```
'guards' => [
    'authxolote' => [
        'driver' => 'authxolote',
        'provider' => 'users',
    ],
],
```

Usage
-----

[](#usage)

### Authentication

[](#authentication)

Once configured, you can use the `authxolote` guard in your routes or controllers:

```
Route::middleware('auth:authxolote')->get('/user', function (Request $request) {
    return $request->user();
});
```

### Checking Permissions

[](#checking-permissions)

You can easily check for permissions using the `Authxolote` facade:

```
use Authxolote\Sdk\Authxolote;

// Check a single permission
if (Authxolote::action('edit-posts')->isAllow()) {
    // User has permission
}

// Check multiple permissions (all must be allowed)
if (Authxolote::actions(['edit-posts', 'delete-posts'])->isAllowAll()) {
    // User has all permissions
}
```

### User Registration

[](#user-registration)

Register new users directly through the SDK:

```
use Authxolote\Sdk\Authxolote;

$user = Authxolote::register(
    'user@example.com',
    'John Doe',
    'password123',
    'admin' // role key
);
```

### Console Commands

[](#console-commands)

Synchronize roles and actions defined in your config:

```
php artisan authxolote:actions
```

Testing
-------

[](#testing)

The SDK provides a built-in fake mode to facilitate unit testing without making actual API calls:

```
use Authxolote\Sdk\Authxolote;

// Fake specific actions
Authxolote::actionsFake(['edit-posts']);

// Now this will return true without calling the API
Authxolote::action('edit-posts')->isAllow();

// This will return false
Authxolote::action('other-action')->isAllow();
```

### Middleware

[](#middleware)

The SDK includes a middleware to protect your routes based on permissions. It is automatically registered as `isAllow`.

#### Basic Usage

[](#basic-usage)

You can use it in your routes:

```
Route::middleware(['auth:authxolote', 'isAllow:edit-posts'])->get('/posts/edit', function () {
    // Only users with 'edit-posts' permission can access this
});
```

#### Controller Groups Example

[](#controller-groups-example)

It is recommended to use a naming convention like `project.module.action` for your permissions. Here is an example using a controller group:

```
use App\Http\Controllers\TurnController;
use Illuminate\Support\Facades\Route;

Route::controller(TurnController::class)->group(function () {
    Route::post('', 'store')->middleware('isAllow:gob.turn.store');
    Route::get('/{id}', 'show')->middleware('isAllow:gob.turn.show');
    Route::put('/{id}', 'update')->middleware('isAllow:gob.turn.update');
    Route::delete('/{id}', 'delete')->middleware('isAllow:gob.turn.delete');
});
```

If the user does not have permission, the middleware will:

- Return a JSON response with status 403 if the request expects JSON.
- Throw a 403 HTTP exception otherwise.

To use this middleware, your User model (or the object returned by the guard) must use the `Authxolote\Sdk\Traits\HasActions` trait.

Credits
-------

[](#credits)

- [Luis Ozuna](https://github.com/LuisOzParr)

License
-------

[](#license)

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

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance93

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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 ~0 days

Total

2

Last Release

85d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/axolote-source-authxolote-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/axolote-source-authxolote-sdk/health.svg)](https://phpackages.com/packages/axolote-source-authxolote-sdk)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[olssonm/l5-very-basic-auth

Laravel stateless HTTP basic auth without the need for a database

1662.5M1](/packages/olssonm-l5-very-basic-auth)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)[pschocke/laravel-telegram-login-widget

Easily integrate Telegrams login widget into your Laravel application to send Telegram messages

1610.4k](/packages/pschocke-laravel-telegram-login-widget)

PHPackages © 2026

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