From e18d79aa403a2b587ed14cadfd01ae0c9bb098ba Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Tue, 9 Dec 2025 04:08:38 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Refactor=20Laravel=20Boost=20MCP?= =?UTF-8?q?=20server=20configuration=20and=20enhance=20routing=20structure?= =?UTF-8?q?=20with=20new=20endpoints,=20redirects,=20and=20country-specifi?= =?UTF-8?q?c=20route=20groups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 🛠️ Updated Laravel Boost MCP server command from `vendor/bin/sail` to `docker` with proper arguments - 🌐 Added comprehensive routing structure including country-specific groups, dashboard redirects, and meetup/calendar routes - 📝 Included new test routes, error handling, and image serving capabilities - 🔧 Enhanced authentication middleware usage with country prefixes for various resource routes - 🚫 Commented out legacy book rental routes while maintaining flexibility for future activation - 🔄 Implemented fallback 404 handling with rate limiting and included auth routes from separate file --- .continue/mcpServers/laravel-boost.yaml | 11 ++++--- routes/web.php | 42 ++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/.continue/mcpServers/laravel-boost.yaml b/.continue/mcpServers/laravel-boost.yaml index c2a120f..31485dc 100644 --- a/.continue/mcpServers/laravel-boost.yaml +++ b/.continue/mcpServers/laravel-boost.yaml @@ -1,11 +1,14 @@ -name: Laravel Boost +name: laravel-boost version: 0.0.1 schema: v1 - mcpServers: - name: laravel-boost - command: vendor/bin/sail + command: docker args: - - artisan + - exec + - -i + - einundzwanzig-app-laravel.test-1 + - php + - /var/www/html/artisan - boost:mcp env: {} diff --git a/routes/web.php b/routes/web.php index 4d5fb55..6444ece 100644 --- a/routes/web.php +++ b/routes/web.php @@ -4,19 +4,26 @@ use Illuminate\Support\Facades\Route; use Laravel\Nightwatch\Http\Middleware\Sample; use Livewire\Volt\Volt; +// Redirect root URL to 'welcome' page Route::redirect('/', 'welcome'); +// Test route that dispatches a job to fetch Nostr profile for user with ID 1426 Route::get('test', function () { \App\Jobs\FetchNostrProfileJob::dispatchSync(\App\Models\User::find(1426)); }); +// Error page route that aborts with given HTTP status code Route::get('error/{code}', function ($code) { abort($code); }); +/* + * Commented out routes related to book rental download and display + * These are currently inactive but can be enabled if needed + */ /*Route::get('/download-buecherverleih', function (Request $request) { $filename = $request->input('filename'); - // Get the file path from the public folder + // Get the file path from the storage folder $filePath = storage_path('app/'.$filename); dd($filePath); // Check if the file exists @@ -31,53 +38,67 @@ Route::middleware([]) ->get('/buecherverleih', \App\Livewire\BooksForPlebs\BookRentalGuide::class) ->name('buecherverleih');*/ +// Route for the rabbit following helper page Route::middleware([]) ->get('/kaninchenbau', \App\Livewire\Helper\FollowTheRabbit::class) ->name('kaninchenbau'); +// Generic image handler route that serves images from storage Route::get('/img/{path}', \App\Http\Controllers\ImageController::class) ->where('path', '.*') ->name('img'); +// Public image handler route for serving public images Route::get('/img-public/{path}', \App\Http\Controllers\ImageController::class) ->where('path', '.*') ->name('imgPublic'); +// Welcome page route using Volt component Volt::route('welcome', 'welcome')->name('welcome'); +// Stream calendar route to download meetup calendar as ICS file Route::get('stream-calendar', \App\Http\Controllers\DownloadMeetupCalendar::class) ->name('ics'); +// Dashboard redirect route for authenticated users, redirects to German dashboard Route::middleware(['auth']) ->get('dashboard', function () { - return redirect('/de/dashboard'); // Zu /de weiterleiten + return redirect('/de/dashboard'); // Redirect to German dashboard }); +// Country-specific routes group (optional country code parameter) Route::middleware([]) ->prefix('/{country:code?}') ->group(function () { Volt::route('dashboard', 'dashboard')->name('dashboard'); }); +// Country-specific routes group with mandatory country code parameter Route::middleware([]) ->prefix('/{country:code}') ->group(function () { - /* OLD URLS */ + /* OLD URLS - redirects for legacy URLs */ + // Redirect old meetup calendar route to new one Route::get('meetup/stream-calendar', \App\Http\Controllers\DownloadMeetupCalendar::class) ->name('ics'); + // Redirect old meetup overview URL to new meetups page Route::get('/meetup/overview', function ($country) { return redirect("/{$country}/meetups"); }); + // Redirect old meetup world URL to new map page Route::get('/meetup/world', function ($country) { return redirect("/{$country}/map"); }); + // Redirect old meetup events URL to new meetups page Route::get('/meetup/meetup-events', function ($country) { return redirect("/{$country}/meetups"); }); + // Old event landing page route (deprecated) Volt::route('meetup/meetup-events/l/{event}', 'meetups.landingpage-event') ->name('meetups.landingpage-event-old') ->where('event', '[0-9]+'); + // Meetup related routes Volt::route('meetups', 'meetups.index')->name('meetups.index'); Volt::route('all-meetups', 'meetups.index')->name('meetups.index-all'); Volt::route('map', 'meetups.map')->name('meetups.map'); @@ -88,12 +109,15 @@ Route::middleware([]) ->name('meetups.landingpage-event') ->where('event', '[0-9]+'); + // Course related routes Volt::route('courses', 'courses.index')->name('courses.index'); Volt::route('course/{course}', 'courses.landingpage')->name('courses.landingpage'); Volt::route('course/{course}/event/{event}', 'courses.landingpage-event')->name('courses.landingpage-event'); + // Lecturer related routes Volt::route('lecturers', 'lecturers.index')->name('lecturers.index'); + // City and venue related routes Volt::route('cities', 'cities.index')->name('cities.index'); Volt::route('venues', 'venues.index')->name('venues.index'); @@ -102,32 +126,39 @@ Route::middleware([]) Volt::route('service/{service:slug}', 'services.landingpage')->name('services.landingpage'); }); +// Authenticated user routes with country prefix Route::middleware(['auth']) ->prefix('/{country:code}') ->group(function () { + // Meetup creation and editing routes Volt::route('meetup-create', 'meetups.create')->name('meetups.create'); Volt::route('meetup-edit/{meetup}', 'meetups.edit')->name('meetups.edit'); Volt::route('meetup/{meetup}/events/create', 'meetups.create-edit-events')->name('meetups.events.create'); Volt::route('meetup/{meetup}/events/{event}/edit', 'meetups.create-edit-events')->name('meetups.events.edit'); + // Course creation and editing routes Volt::route('course-create', 'courses.create')->name('courses.create'); Volt::route('course-edit/{course}', 'courses.edit')->name('courses.edit'); Volt::route('course/{course}/events/create', 'courses.create-edit-events')->name('courses.events.create'); Volt::route('course/{course}/events/{event}/edit', 'courses.create-edit-events')->name('courses.events.edit'); + // Lecturer creation and editing routes Volt::route('lecturer-create', 'lecturers.create')->name('lecturers.create'); Volt::route('lecturer-edit/{lecturer}', 'lecturers.edit')->name('lecturers.edit'); + // City creation and editing routes Volt::route('city-create', 'cities.create')->name('cities.create'); Volt::route('city-edit/{city}', 'cities.edit')->name('cities.edit'); + // Venue creation and editing routes Volt::route('venue-create', 'venues.create')->name('venues.create'); Volt::route('venue-edit/{venue}', 'venues.edit')->name('venues.edit'); - // Self Hosted Services protected routes + // Self Hosted Services protected routes (authenticated users only) Volt::route('service-create', 'services.create')->name('services.create'); Volt::route('service-edit/{service}', 'services.edit')->name('services.edit'); + // Settings redirects and routes Route::redirect('settings', 'settings/profile'); Volt::route('settings/profile', 'settings.profile')->name('settings.profile'); @@ -135,9 +166,12 @@ Route::middleware(['auth']) Volt::route('settings/appearance', 'settings.appearance')->name('settings.appearance'); }); +// Commented out feed routes (RSS/Atom feeds) //Route::feeds(); +// Fallback route for handling 404 errors with rate limiting Route::fallback(fn () => abort(404)) ->middleware(Sample::rate(0.5)); +// Include authentication routes from auth.php file require __DIR__.'/auth.php';