Laravel Request::is() - is there a better way?
is()
method iterates over arguments:
foreach (func_get_args() as $pattern) {
if (Str::is($pattern, $this->decodedPath())) {
return true;
}
}
So, something like this should work for you:
@if(Request::is('login', 'tags', 'categories', 'posts', 'tags/..', 'categories/..', 'posts/..', 'posts/{$post->id}'))