/** * Return a path for special shorthand in links. * * New link shorthand should be defined here, following the pattern * currently used for tutorials. * * A hook for this can be installed by withCallbacks(). */ protected function urlCallback($path) { $m = []; if (preg_match('/^tutorials?\\/([0-9]+)$/', $path, $m)) { if ($t = \LearnTutorialSaurus::getById($m[1])) { return \Learn::externalLink('tutorials')->id($t->url_path); } } // we didn't find anything return null; }