I created a view inicio.blade.php
where I put all the code that repeats on all pages and created other views that extend this view.
I've created routes for views by setting a name for them like this:
Route::get('/', 'PainelController@painel')->name('painel');
Route::get('calendario', 'PainelController@calendario')->name('calendario');
But in the inicio
view view there are some files that are only used on some pages.
I've seen that it's possible to use conditional to check which route it is in, but the way I'm doing it is not working properly. Regardless of the route I'm in the condition always returns true.
I did it that way (I copied from the template the laravel creates ):
@if (Route::has('calendario'))
<link rel="stylesheet" href="{{asset('css/owl.carousel.css')}}" type="text/css">
@endif
I even printed the route to see if it was correct and it returns true, but the condition always returns true:
<!--{{Route::currentRouteName()}}-->
If this is not the correct way could you tell me how to do it?