Answer the question
In order to leave comments, you need to log in
How to check Request::is on a page where there is an id?
How to check Request::is if the page has an id. Let's say company/id
@if(Request::is('company', 'company/..')) active @else disabled @endif
'company/[0-9]'
Answer the question
In order to leave comments, you need to log in
An example from the documentation
https://laravel.com/docs/5.8/requests
Template validation
:
if ($request->is('company/*')) {
//
}
Where exactly do you want to validate? Blade file?
You can organize a bool variable that returns true / false depending on the route, and define it at the controller level - this is an option for solving your problem.
I think you have 2 routes that work with different methods of the same controller.
Accordingly, define a variable in each method ,.
Describe your task in more detail, in which file, which routes you use.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question