php - Why my route is not working perfectly in Laravel 8?

I am using Laravel 8 withfortify
auth without Jetstream.
web.php
Route::get('/facade_version', function () {
dd('EXAMPLE');
})->name('postcard.facade');
Above is my route
index.blade.php
<a href="{{ route('postcard.facade') }}" type="a" class="btn btn-success">facade postcard</a>
Output in Screen
Route [postcard.facade] not defined. (View: E:\github\LARAVEL\laravel8-fortify\resources\views\facade\index.blade.php)
I tried with second way usinghttp://127.0.0.1:8000/facade_version
in url
Output in Screen
404 | Not Found
Everything is ok But I could not figure it out whats the problem.
I have done this kind of route before with same way.
But this is not working
Look at the below route. it works perfectly.
Route::get('/post-cards', function () {
$postcardService = new PostcardSendingService('USA', 4, 6);
$postcardService->hello('Hello from Coder Tape USA!!', '[email protected]');
})->name('postcard.index');
- I just edit the link to
/post-cardsss
instead of/post-cards
' then again the route is not found
Note
Today I ran these commands in my projects
php artisan config:clear
php artisan view:clear
php artisan cache:clear
php artisan route:cache
composer dump-autoload
Answer
Solution:
Solved it using this command
php artisan route:clear
And run the project again
Answer
Solution:
I have tried those steps from laravel documentation and solved my issue
composer install --optimize-autoloader --no-dev
and then
php artisan config:cache
and again
php artisan route:cache
this was the most important may as we were missing route information
php artisan view:cache
Great laravel documentation is here
Thank you.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: too few arguments to function laravel
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.