Assign a key to middleware in package development

Posted 4 months ago by Tetravalence

Hello, I'd like to share Middlewares across a group of routes without needing to use their FQN. I know it's possible to assign the Middleware a key in app/Http/Kernel.php but I'm looking for a solution in package development that does not require to change the aforementioned file. Right now I'm using the MyPackageDashboard Middleware by means of his FQN

Route::middleware('auth', Tetravalence\MyPackage\Http\Middleware\MyPackageDashboard::class)->group(function () {
...
// group of routes
});

Where can I set up these keys in package development?

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.