Skip to main content
This article is based on source-code research (the 1.x branch). There are no official docs yet, and the package is pre-release (as of April 2026).

What is Sentinel?

Laravel Sentinel is a security middleware package that controls access to routes using a driver-based approach. It’s developed by Taylor Otwell and Mior Muhammad Zaki and supports PHP ^8.0 / Laravel 8–13. Its primary use is protecting administrative routes like Telescope, Horizon, and Pulse. Just apply SentinelMiddleware to routes and access is controlled by the authorization logic defined in the driver.

Compared to the traditional approach

Telescope and Horizon each had their own gate-based authorization mechanism.
That method depends on the user’s authentication state and has the problem of “you can’t decide unless someone is logged in.” Because Sentinel works as middleware, it controls access per request regardless of authentication. It also lets you define rules for multiple admin tools in one place.

Installation

Because SentinelServiceProvider is registered in composer.json’s extra.laravel.providers, the service provider is auto-detected. No config file publishing is needed.

Package architecture

Default driver (the Laravel driver) behavior

The default Laravel driver applies controls only in the local environment (APP_ENV=local).
The flow summarized:
The Laravel driver always returns true (allow) outside the local environment. If you need access control in production, create a custom driver.

Private IP detection

The base Driver class’s isPrivateIp() uses Symfony’s IpUtils and treats the following IP ranges as private.

Docker local detection

If REMOTE_ADDR is 127.0.0.1 and a .dockerenv file exists at the project root, the environment is judged to be Docker local.

Using it as middleware

Basic usage

Specifying a driver

You can pass a driver name as an argument to the middleware. If a non-existent driver name is passed, it falls back to the default driver (via driverOrFallback()).

Middleware implementation

If authorize() returns false, it aborts with HTTP 401. You can also throw an AuthorizationException via Driver::authorizeOrFail() (though the middleware itself does not use this).

Creating a custom driver

You can create a custom driver by extending the Driver abstract class and implementing authorize().
Register via extend() in AppServiceProvider::boot(), for example.

Using base class utility methods

The Driver class provides helpful utilities like IP detection that custom drivers can freely use.

How SentinelManager works

SentinelManager extends Illuminate\Support\Manager. Manager is Laravel’s base class for implementing the driver pattern; it caches driver instances via driver().
driverOrFallback() silently falls back to the default driver if the specified driver is missing, so passing a non-existent driver name to the middleware argument doesn’t error out. Because SentinelManager is registered as a scoped singleton (scoped) by SentinelServiceProvider, the driver instance is reused within a single request.

Summary

laravel/sentinel is a small package, but its driver pattern via Illuminate\Support\Manager gives it high extensibility. The default Laravel driver is specialized in preventing access via tunneling services during local development. To protect production, you need to create your own custom driver. When official documentation lands, more concrete usage patterns should become clear.

laravel/sentinel repository

See the source and latest changes on the GitHub 1.x branch.
Last modified on July 13, 2026