diff --git a/app/Functions/Blade.php b/app/Functions/Blade.php index fe29f59..d1efcaf 100644 --- a/app/Functions/Blade.php +++ b/app/Functions/Blade.php @@ -40,3 +40,16 @@ function asset($path, $prefix = '/public') return $path; } + +/** + * getting name of view as slug + * + * @param array $page + * @return string + * + */ +function viewName(array $page) +{ + $slugify = new \Cocur\Slugify\Slugify(); + return $slugify->slugify($page['data']['view']); +} diff --git a/resources/views/layout.blade.php b/resources/views/layout.blade.php index 847b61d..640842f 100644 --- a/resources/views/layout.blade.php +++ b/resources/views/layout.blade.php @@ -1,6 +1,5 @@ @inject('pageRepository', 'App\Repositories\PageRepository') @inject('markdownHelper', 'App\Helpers\MarkdownHelper') -@inject('slugify', 'Cocur\Slugify\Slugify') @@ -17,7 +16,7 @@ @stack('head') -
+