mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-12 09:54:03 +00:00
Make default & modifier setters chainable
This commit is contained in:
parent
5732fc8a57
commit
8b6e049830
2 changed files with 6 additions and 0 deletions
|
|
@ -206,7 +206,9 @@ class SEOManager
|
||||||
|
|
||||||
if (isset($arguments[0])) {
|
if (isset($arguments[0])) {
|
||||||
$this->set($key, $arguments[0]);
|
$this->set($key, $arguments[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($arguments[0]) || isset($arguments['default']) || isset($arguments['modifier']) || isset($arguments['modify'])) {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,3 +78,7 @@ test('thunks can be used as defaults', function () {
|
||||||
|
|
||||||
expect(seo('title'))->toBe('bar');
|
expect(seo('title'))->toBe('bar');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('setting the defaults returns the manager instance', function () {
|
||||||
|
expect(seo()->title(default: 'foo'))->toBeInstanceOf(SEOManager::class);
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue