I have added signed route. and it is working perfectly. but the problem is, when I start the server and hit 127.0.0.1:8000
in the browser it shows 403 INVALID SIGNATURE
. when I give a route like this 127.0.0.1:8000/welcome
than it is working. please someone help me, so that this 127.0.0.1:8000
works with sign route.
i am using laravel 9
My Route Route::get('/', [App\Http\Controllers\website\HomeController::class, 'index'])->name('/')->middleware('signed');
1 Answer
Answer in your question. If do you want to use signed url for root page you must implement this with sign. You don't. If you define your route like this:
Route::get('/', [App\Http\Controllers\website\HomeController::class, 'index'])->name('/')->middleware('signed');
you should use sign for access this page.
For example imagine two routes
Route::get('/a', [HomeController::class,'index'])->name('homepage');
Route::get('/', [HomeController::class,'index'])->name('homepage2')->middleware('signed');
if in your index view you call signed homepage2 you don't get 403
127.0.0.1:8000/
(i.e. route/
) without providing a valid signature. You specified this requirement yourself when requiring/
to be signed. I don't understand what your issue is here. Are you actually providing a valid signature and it's not working?http://127.0.0.1:8000/
in the browser. first time this shows 403. but when i brows other URL than it is working file.