I have a route defined like such:
Route::get('aanmelden/{companySlug}/{packageSlug}', ['as' => 'register', 'uses' => 'UsersController@create'])
I want to display some extra plug-in on this specific page, so in the header I want an if loop that checks for the prefix 'register' to display the code.. No luck yet. I tried this:
@if(Request::is('register'))
@if(Request::path() == 'aanmelden')
If you want to check route name, do something like this:
@if (Route::currentRouteName() === 'register')
If you want to check if route name starts with register (so it's like prefix), use starts_with() helper:
@if (starts_with(Route::currentRouteName(), 'register'))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With