tenancy-docs/docs/source/v1/middleware-configuration.blade.md
Samuel Štancl ae63f30be6 New routes
2019-09-21 22:10:32 +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');
    });
});