Laravel - Requests - Inspecting The Request Path

The is method allows you to verify that the incoming request path matches a given pattern. You may use the * character as a wildcard when utilizing this method:

    
    if ($request->is('admin/*')) {
        //
    }
	

Using the routeIs method, you may determine if the incoming request has matched a named route:

    
    if ($request->routeIs('admin.*')) {
        //
    }