public function matches(Request $request) { $uri = $request->uri(); $indexes = []; foreach ($this->indexes as $prefix => $index) { if (strpos($uri, $prefix) === 0) { $indexes += $index; } } return $indexes; }
public function matches(Request $request, array $filtered) { $uri = $request->uri(); foreach (array_intersect_key($this->indexes, $filtered) as $i => $pattern) { if (preg_match($pattern, $uri, $paths)) { foreach ($paths as $name => $value) { is_string($name) && !isset($request[$name]) && ($request[$name] = $value); } return [$i => 1]; } } return []; }
function resolve(Request $request) { if (!$this->actions || !isset($this->actions[$request->method()])) { return; } $uri = $request->uri(); $actions = $this->actions[$request->method()]; foreach ($actions as $route => $action) { if ($this->compiler->checkSymbol($route)) { $pattern = $this->compiler->compile($route); if (preg_match($pattern, $uri, $paths)) { foreach ($paths as $name => $value) { is_string($name) && !isset($request[$name]) && ($request[$name] = $value); } return $action; } } else { if ($route == $request->uri()) { return $action; } } } }
public function matches(Request $request) { return $this->indexes[$request->isAjax()]; }
public function matches(Request $request) { return isset($this->indexes[$request->uri()]) ? $this->indexes[$request->uri()] : []; }