1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 09:34:05 +00:00
tenancy/source/docs/middleware-configuration.md
Samuel Štancl a92690cea8 wip
2019-08-16 22:09:01 +02:00

743 B

title description extends section
Middleware Configuration Middleware Configuration with stancl/tenancy — A Laravel multi-database tenancy package that respects your code.. _layouts.documentation content

Middleware Configuration

When a tenant route is visited and the tenant can't be identified, an exception is thrown. If you want to change this behavior, to a redirect for example, add this to your app/Providers/AppServiceProvider.php's boot() method:

// use Stancl\Tenancy\Middleware\InitializeTenancy;

$this->app->bind(InitializeTenancy::class, function ($app) {
    return new InitializeTenancy(function ($exception) {
        // return redirect()->route('foo');
    });
});