It is sometimes you need to control your view page(.blade.php) based on url visited by user. You can check if user visited by a Controller or Controller+Action both. It can be now done by Laravel very easily. Below is code snippet to do the tricks.
@if (Request::is('controller/*'))
<!-- code block here -->
@endif
@if (Request::is('controller/action'))
<!-- code block here -->
@endif
@if (Request::is('controller/*'))
<!-- code block here -->
@endif
@if (Request::is('controller/action'))
<!-- code block here -->
@endif
No comments:
Post a Comment