where(['platform' => '[a-z][a-z0-9_]{0,19}'])->group(function () { Route::get('/', [SharingController::class, 'index'])->name('sharing.index')->middleware('can:sharing.view'); Route::get('/{platform}/connect', [SharingController::class, 'connect'])->name('sharing.connect')->middleware('can:sharing.manage'); Route::get('/{platform}/callback', [SharingController::class, 'callback'])->name('sharing.callback')->middleware('can:sharing.manage'); Route::delete('/{platform}', [SharingController::class, 'disconnect'])->name('sharing.disconnect')->middleware('can:sharing.manage'); }); Route::get('/posts/{post}/sharing', [SharingController::class, 'post'])->whereNumber('post')->name('sharing.post')->middleware('can:sharing.publish'); Route::post('/posts/{post}/share', [SharingController::class, 'share'])->whereNumber('post')->name('sharing.share')->middleware('can:sharing.publish');