0

I'm new to laravel and I'm having trouble with one of my web routes...

I grouped some routes with the auth middleware

Route::middleware(['auth:web'])->group(function ($router) {

    Route::get('/news', [NewsController::class, 'news'])->name('news');
    Route::get('/profile/{user_id}', [ProfileController::class, 'profile'])->name('profile');
    Route::get('/marketplace', [MarketplaceController::class, 'marketplace'])->name('marketplace');

});

Before this issue, I have set a user_id parameter for the news route and then removed it the next day, now the news route keeps returning error saying it needs user_id.

here's my controller:

    <?php

namespace App\Http\Controllers;

class NewsController extends Controller
{

    public function news() {

        return view('modules.news.news');

    }
}

and since im using laravel-vue mix, my modules.news.news view looks like this:

@section('content')
    <newsfeed inline-template>
        <div>
            ...
            ...
        </div>
    </newsfeed>
@endsection

I've checked the web route, the controller, the blade, and I really can't see anything that requiring the news route to receive a parameter.

can someone point out where I went wrong?

modi
  • 297
  • 2
  • 3
  • 15

1 Answers1

1

Your route file might be cached, try running php artisan route:clear and see if this fixes the issue.

  • 1
    Damn, took me almost an hour to resolve the issue and this is all I had to do. Sheez. Thanks man @Christian Holladay – modi Jan 26 '21 at 18:18