app \ exceptions \ ModelNotFoundException
Model 'app\models\Page' not found app\exceptions\ModelNotFoundException thrown with message "Model 'app\models\Page' not found" Stacktrace: #10 app\exceptions\ModelNotFoundException in /home/vrande/domains/vrande.nl/public_html/app/system/DB/Model/QueryBuilder.php:44 #9 app\system\DB\Model\QueryBuilder:firstOrFail in /home/vrande/domains/vrande.nl/public_html/app/http/middleware/SetPage.php:33 #8 app\http\middleware\SetPage:run in /home/vrande/domains/vrande.nl/public_html/app/system/Router/Middleware.php:78 #7 app\system\Router\Middleware:runMiddleware in /home/vrande/domains/vrande.nl/public_html/app/system/Router/Middleware.php:69 #6 app\system\Router\Middleware:run in /home/vrande/domains/vrande.nl/public_html/app/concerns/IsSingleton.php:34 #5 app\system\Middleware:__callStatic in /home/vrande/domains/vrande.nl/public_html/app/system/Router/Route.php:149 #4 app\system\Router\Route:runMiddleware in /home/vrande/domains/vrande.nl/public_html/app/system/Router/Router.php:92 #3 app\system\Router\Router:callRoute in /home/vrande/domains/vrande.nl/public_html/app/system/Router/Router.php:80 #2 app\system\Router\Router:run in /home/vrande/domains/vrande.nl/public_html/app/system/Routing.php:210 #1 app\system\Routing:run in /home/vrande/domains/vrande.nl/public_html/app/system/App.php:166 #0 app\system\App:run in /home/vrande/domains/vrande.nl/public_html/index.php:10
Stack frames (11)
10
app\exceptions\ModelNotFoundException
/app/system/DB/Model/QueryBuilder.php44
9
app\system\DB\Model\QueryBuilder firstOrFail
/app/http/middleware/SetPage.php33
8
app\http\middleware\SetPage run
/app/system/Router/Middleware.php78
7
app\system\Router\Middleware runMiddleware
/app/system/Router/Middleware.php69
6
app\system\Router\Middleware run
/app/concerns/IsSingleton.php34
5
app\system\Middleware __callStatic
/app/system/Router/Route.php149
4
app\system\Router\Route runMiddleware
/app/system/Router/Router.php92
3
app\system\Router\Router callRoute
/app/system/Router/Router.php80
2
app\system\Router\Router run
/app/system/Routing.php210
1
app\system\Routing run
/app/system/App.php166
0
app\system\App run
/index.php10
/home/vrande/domains/vrande.nl/public_html/app/system/DB/Model/QueryBuilder.php
        parent::__construct();

        $this->model = $model;

        $this->getContent()->table($model->getTable(true), $model->getTableAlias());

        $this->wrap(
            fn($item) => $this->model->newInstance()->fillFromSource($item)
        );
    }

    public function qualifyColumn($column)
    {
        return $this->model->qualifyColumn($column);
    }

    public function firstOrFail()
    {
        if (is_null($result = $this->first())) {
            throw new ModelNotFoundException(get_class($this->getModel()));
        }

        return $result;
    }

    public function newInstance(): QueryBuilder
    {
        return new static($this->model);
    }

    public function getModel(): CoreModel
    {
        return $this->model;
    }

    public function __call($name, $arguments)
    {
        $scopedQuery = 'query'.ucfirst($name);

        if (method_exists($this->model, $scopedQuery)) {
/home/vrande/domains/vrande.nl/public_html/app/http/middleware/SetPage.php
    public function run(array $parameters)
    {
        if ($id = App::request()->query('page_id')) {
            App::setPage(Page::where('id', $id)->withoutDisabled()->firstOrFail());
        } else {
            // First we check if either slug, parentSlug or headSlug has been set
            $slug = ($parameters['slug'] ?? $parameters['parentSlug'] ?? $parameters['headSlug'] ?? null);

            $hasSlug = ($slug !== null);

            // If not we try and get the nth segment of the route (i.e. /nl/{second-segment})
            // In case all of these haven't worked we assume we are on Home
            if ($slug === null) {
                $nth = (App::request()->currentRoute()->hasParameter('lang') ? 2 : 1);

                $slug = (App::request()->segment($nth) ?: 'home');
            }

            $page = Page::whereSlug($slug)->withoutDisabled()->firstOrFail();

            // Globalize the found page
            App::setPage($page);

            // Globalize the head page if used
            if ($hasSlug && $this->hasHead($parameters)) {
                App::set('head_page', Page::whereSlug($this->getHeadSlug($parameters))->withoutDisabled()->first());
            }
        }

        $this->setOldWebsite($page->id); // @todo: Remove when not needed anymore.
    }

    protected function hasHead(array $parameters): bool
    {
        return ($this->getHeadSlug($parameters) !== null);
    }

    protected function getHeadSlug(array $parameters): ?string
    {
/home/vrande/domains/vrande.nl/public_html/app/system/Router/Middleware.php
            if (!isset($this->middleware[$name])) {
                throw new \Exception("Middleware '{$name}' has not been registered");
            }

            $middleware = $this->middleware[$name];

            if (is_array($middleware)) {
                $this->run($middleware);
            }
            else {
                if ($this->runMiddleware($middleware, $parameters) === false) {
                    break;
                }
            }
        }
    }

    public function runMiddleware($class, array $parameters = [])
    {
        return (new $class)->run($parameters);
    }

}
 
/home/vrande/domains/vrande.nl/public_html/app/system/Router/Middleware.php
    {
        return $this->withGlobals(false);
    }

    public function run(array $names, array $parameters = [])
    {
        $all = ($this->runGlobals ? array_merge($this->global, $names) : $names);

        foreach ($all as $name) {
            if (!isset($this->middleware[$name])) {
                throw new \Exception("Middleware '{$name}' has not been registered");
            }

            $middleware = $this->middleware[$name];

            if (is_array($middleware)) {
                $this->run($middleware);
            }
            else {
                if ($this->runMiddleware($middleware, $parameters) === false) {
                    break;
                }
            }
        }
    }

    public function runMiddleware($class, array $parameters = [])
    {
        return (new $class)->run($parameters);
    }

}
 
/home/vrande/domains/vrande.nl/public_html/app/concerns/IsSingleton.php
    }

    public static function getInstance(): self
    {
        if (!isset(static::$instance)) {
            static::$instance = static::newInstance();
        }

        return static::$instance;
    }

    public static function __callStatic($name, $arguments)
    {
        $inst = static::getInstance();

        if (method_exists($inst, 'forwardCallsTo')) {
            if (method_exists($inst->forwardCallsTo(), $name)) {
                $class = $inst->forwardCallsTo();

                return $class->{$name}(...$arguments);
            }
        }
    }

}
 
/home/vrande/domains/vrande.nl/public_html/app/system/Router/Route.php
    public function call()
    {
        App::event('route.calling', $this);

        $callback = $this->callback;
        $arguments = $this->prepareParameters($callback, $this->parameters);

        if (is_array($callback)) {
            [$controller, $method] = $callback;

            return (new $controller)->{$method}(...$arguments);
        }

        return $callback(...$arguments);
    }

    public function runMiddleware(): self
    {
        Middleware::run($this->getMiddleware(), $this->getParameters());

        return $this;
    }

    public function getParameters(): array
    {
        return $this->parameters;
    }

    public function hasParameter($name): bool
    {
        return isset($this->parameters[$name]);
    }

    public function hasRouteParameter($name): bool
    {
        $route = $this->getRoute();

        return $this->remember(fn () => (new Matcher($route))->hasParameterName($name), __FUNCTION__);
    }
/home/vrande/domains/vrande.nl/public_html/app/system/Router/Router.php
        }

        $method = App::request()->method();

        if (!empty($this->routes)) {
            foreach ($this->getRoutes() as $route) {
                if ($route->matches($method, $this->routeUrl)) {
                    return $this->callRoute($route);
                }
            }

            throw new RouteNotFoundException($this->routeUrl, $method);
        }
    }

    protected function callRoute(Route $route)
    {
        $this->currentRoute = $route;

        return $route->runMiddleware()->call();
    }

    /**
     * @return Route[]
     */
    public function getRoutes(): array
    {
        return $this->routes;
    }

    public function getCurrentRoute(): Route
    {
        return $this->currentRoute;
    }

    /**
     * @return Route[]
     */
    public static function getAllRoutes(): array
    {
/home/vrande/domains/vrande.nl/public_html/app/system/Router/Router.php
            $route->group($group);
        }

        static::$allRoutes[] = $this->routes[] = $route;

        return $this;
    }

    public function run()
    {
        if ($this->disabled) {
            return null;
        }

        $method = App::request()->method();

        if (!empty($this->routes)) {
            foreach ($this->getRoutes() as $route) {
                if ($route->matches($method, $this->routeUrl)) {
                    return $this->callRoute($route);
                }
            }

            throw new RouteNotFoundException($this->routeUrl, $method);
        }
    }

    protected function callRoute(Route $route)
    {
        $this->currentRoute = $route;

        return $route->runMiddleware()->call();
    }

    /**
     * @return Route[]
     */
    public function getRoutes(): array
    {
        return $this->routes;
/home/vrande/domains/vrande.nl/public_html/app/system/Routing.php
     * @param array $arguments
     * @return Route
     */
    public static function delete($route, $callback, array $arguments = []): Route
    {
        static::getInstance()->getRouter()->add(
            $route = new Route('delete', $route, $callback, $arguments)
        );

        return $route;
    }

    /**
     * Try and match the given routes
     * @return mixed|null
     * @throws \app\exceptions\RouteNotFoundException
     */
    public static function run()
    {
        return static::getInstance()->getRouter()->run();
    }

    public function getRouter(): Router
    {
        return $this->router;
    }

    /**
     * Get the currently used route
     * @return Route
     */
    public static function getCurrentRoute(): Route
    {
        return static::getInstance()->getRouter()->getCurrentRoute();
    }

    public static function getInstance(): self
    {
        if (!isset(static::$instance)) {
            static::$instance = new static;
/home/vrande/domains/vrande.nl/public_html/app/system/App.php
    {
        return static::instance()->traitRemember($callback, $key);
    }

    public static function set($key, $value)
    {
        static::instance()->setMemory($key, $value);
    }

    public static function get($key)
    {
        return static::instance()->fromMemory($key);
    }

    public static function run()
    {
        try {
            static::event('booted');

            return Routing::run();
        } catch (Throwable $ex) {
            return Kernel::handle($ex);
        } finally {
            Session::transferFlashed();
        }
    }

}
 
/home/vrande/domains/vrande.nl/public_html/index.php
<?php
 
include_once(__DIR__.'/includes/main.php');
 
use app\system\App;
 
// Backwards compatibility
$dbase->connect();
 
echo App::run();
 

Environment & details:

Key Value
route case-221f-high-speed
empty
empty
Key Value
PHPSESSID 0af7da0c198dce067e122e54c72bf27d
Key Value
url_qry route=case-221f-high-speed
_flashed Array ( [old] => Array ( ) [new] => Array ( ) )
Key Value
PATH /usr/local/bin:/usr/bin:/bin
TEMP /tmp
TMP /tmp
TMPDIR /tmp
PWD /
HTTP_ACCEPT */*
HTTP_ACCEPT_ENCODING gzip, br, zstd, deflate
CONTENT_LENGTH 0
HTTP_COOKIE PHPSESSID=0af7da0c198dce067e122e54c72bf27d
HTTP_HOST www.vrande.nl
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
REDIRECT_UNIQUE_ID Zxc72582kEip4o2F54_jHgAAPhE
REDIRECT_HTTPS on
REDIRECT_SSL_TLS_SNI www.vrande.nl
REDIRECT_HTTP2 on
REDIRECT_H2PUSH off
REDIRECT_H2_PUSH off
REDIRECT_H2_PUSHED
REDIRECT_H2_PUSHED_ON
REDIRECT_H2_STREAM_ID 61
REDIRECT_H2_STREAM_TAG 1540309-6603-61
REDIRECT_STATUS 200
UNIQUE_ID Zxc72582kEip4o2F54_jHgAAPhE
HTTPS on
SSL_TLS_SNI www.vrande.nl
HTTP2 on
H2PUSH off
H2_PUSH off
H2_PUSHED
H2_PUSHED_ON
H2_STREAM_ID 61
H2_STREAM_TAG 1540309-6603-61
SERVER_SIGNATURE
SERVER_SOFTWARE Apache/2
SERVER_NAME www.vrande.nl
SERVER_ADDR 87.239.9.207
SERVER_PORT 443
REMOTE_ADDR 18.188.96.85
DOCUMENT_ROOT /home/vrande/domains/vrande.nl/private_html
REQUEST_SCHEME https
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT /home/vrande/domains/vrande.nl/private_html
SERVER_ADMIN webmaster@vrande.nl
SCRIPT_FILENAME /home/vrande/domains/vrande.nl/private_html/index.php
REMOTE_PORT 50503
REDIRECT_URL /case-221f-high-speed
REDIRECT_QUERY_STRING route=case-221f-high-speed
SERVER_PROTOCOL HTTP/2.0
REQUEST_METHOD GET
QUERY_STRING route=case-221f-high-speed
REQUEST_URI /case-221f-high-speed
SCRIPT_NAME /index.php
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1729575899.5606
REQUEST_TIME 1729575899
Key Value
PATH /usr/local/bin:/usr/bin:/bin
TEMP /tmp
TMP /tmp
TMPDIR /tmp
PWD /
0. Whoops\Handler\PrettyPageHandler