skip to Main Content

Laravel Routing: Handling Parameters for Subdomains and Main Domain in a Single Controller Method

There are two groups of routes: for subdomains and the main domain: Route::middleware(['language'])->group(function () { Route::domain('{subdomain}.vizit.loc')->group(function () { Route::controller(FrontSightController::class)->group(function () { Route::get('/sights', 'index')->name('subdomain.main.sights.index'); Route::get('/sights/category/{category_slug}', 'showByCategory')->name('subdomain.main.sights.category.index'); }); }); }); Route::middleware(['language'])->group(function () { Route::domain('vizit.loc')->group(function () Route::controller(FrontSightController::class)->group(function () { Route::get('/sights', 'index')->name('main.sights.index'); Route::get('/sights/category/{category_slug}', 'showByCategory')->name('main.sights.category.index');…

VIEW QUESTION

Laravel – Role & Permission table structure

i want to a role permission list (https://phpout.com/wp-content/uploads/2023/11/z4pne.png) image but i can't set it i have code my table structure and i actually my code is looking like this (https://phpout.com/wp-content/uploads/2023/11/ADku7.png) my code look like this <table class="table"> <thead> <tr> <th…

VIEW QUESTION

How to update Laravel session Id in testing

How can I make the get request load with its session id as what is initially created with $sessionId = session()->getId(); public function test_chatbot_messages_page_has_non_empty_chat(): void { $sessionId = session()->getId(); ChatbotMessage::create([ 'session_id' => $sessionId, 'content' => 'Hello', 'role' => 'You', ]);…

VIEW QUESTION
Back To Top
Search