'path', 'required' => true, 'unique' => true, 'type' => 'string' ], [ 'name' => 'title', 'required' => true, 'unique' => false, 'type' => 'string' ], [ 'name' => 'description', 'required' => true, 'unique' => false, 'type' => 'text' ], [ 'name' => 'keywords', 'required' => true, 'unique' => false, 'type' => 'string' ] ]; public static function getData($path) { if (!preg_match('/^\//', $path)) { $path = "/$path"; } if (preg_match('/^\/(dashboard|login|register)/', $path)) { $page = [ 'title' => 'Dashboard' . ' | ' . env('APP_NAME'), 'description' => '', 'keywords' => '' ]; } else { $page = self::select('title', 'description', 'keywords')->where('path', "$path")->first(); if ($page == null) { $page = [ 'title' => 'Page Not Found' . ' | ' . env('APP_NAME'), 'description' => 'The requested page cannot be found', 'keywords' => '' ]; } } return $page; } }