1
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 created the routes for the views by setting a name for them this way:
Route::get('/', 'PainelController@painel')->name('painel');
Route::get('calendario', 'PainelController@calendario')->name('calendario');
But in the view inicio
there are some files that are only used on some pages.
I saw that it is possible to use conditional to verify which Route is, but the way I am doing are not working properly. Regardless of the route I am in the condition always returns true.
I did it this way (I copied from the model that the Larable calf):
@if (Route::has('calendario'))
<link rel="stylesheet" href="{{asset('css/owl.carousel.css')}}" type="text/css">
@endif
I even had the route printed to see if it was correct and it returns right, but the condition always returns true:
<!--{{Route::currentRouteName()}}-->
If this isn’t the right way, you could tell me how to do it?
Aeh! Saved the day. I’m starting to wonder. I had tried to use the Routename but gave error tmb, I believe it was the amount of equal signal I used that was wrong. But that way it worked now.
– Wendel Rodrigues