The problem is with the quotes, to use string interpolation in PHP you have to use double quotes, like this:
@if (isset($page))
@include("dashboard.dashPages.$page")
@else
@include('dashboard.dashPages.MainPage')
@endif
If you use single quotes, PHP will skip the interpolation, and just return $page as a string, and not as a variable.
Thank you,
Completely forget about that. Such an easy answer haha.
Have a nice day !
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community