Assign a key to middleware in package development

Posted 11 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.