Issue
How can I check Request::is('/new/*')
in a Blade view in Laravel 6? I have no sidebar on the home page. However, I want the sidebar on domain.com/new/x
pages like domain.com/new/231
.
Here's what I did, but it's not working.
@if(Request::is('/new/*'))
@include('inc.sidebar')
@endif
Solution
Are you trying to match routes or URLs? Can you show your routes in web.php?
@if (\Request::is('new/*')) {
// will match URL /new/231 or /new/x
@endif
Answered By - Karl Hill Answer Checked By - Clifford M. (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.