/** * Template URL helper * @param string $path * @param string $template * @return string */ function template_url($path, $template = null) { $config = app('config'); $template = $template ?: $config['app']['template']; if ('adminlte' == Str::lower($template)) { $template = 'adminlte'; } else { if (Str::length($template) > 3) { $template = Str::snake($template, '-'); } else { $template = Str::lower($template); } } $path = sprintf('templates/%s/assets/%s', $template, ltrim($path, '/')); return url($path); }