$expectedValue) { $query = Schema::hasColumn($modelTable, $tableColumn) ? $query->where($tableColumn, $expectedValue) : $query; } } /** * Check if the route handles the HTTP GET method * * @param RoutingRoute $route * @return boolean */ private static function routeHandlesGetMethod(RoutingRoute $route): bool { return in_array('GET', $route->methods()); } /** * Check if the actual route uri start with * a partial uri from the table * Check also if it uses middleware auth * * @param RoutingRoute $route * @return boolean */ private static function routeShouldBeIgnored(RoutingRoute $route): bool { foreach (self::$ignoreRoutes as $iRoute) { if (strpos($route->uri(), ltrim($iRoute, '/')) === 0) { return true; } } foreach ($route->middleware() as $middleware) { if (strpos($middleware, 'auth') === 0) { return true; } } return false; } }