1
0
Fork 0
mirror of https://github.com/archtechx/laravel-seo.git synced 2025-12-12 09:54:03 +00:00

Make seo function straight-forward

This commit is contained in:
Viktor Szépe 2021-09-30 21:09:25 +02:00 committed by GitHub
parent 157318e61b
commit cc285e856c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,12 +7,15 @@ use ArchTech\SEO\SEOManager;
if (! function_exists('seo')) {
function seo(string|array $key = null): SEOManager|string|array|null
{
if (! $key) {
if ($key === null) {
return app('seo');
} elseif (is_array($key)) {
return app('seo')->set($key);
} else {
return app('seo')->get($key);
}
if (is_array($key)) {
return app('seo')->set($key);
}
// String key
return app('seo')->get($key);
}
}