diff --git a/src/SEOManager.php b/src/SEOManager.php index 929289a..5c329ca 100644 --- a/src/SEOManager.php +++ b/src/SEOManager.php @@ -206,7 +206,9 @@ class SEOManager if (isset($arguments[0])) { $this->set($key, $arguments[0]); + } + if (isset($arguments[0]) || isset($arguments['default']) || isset($arguments['modifier']) || isset($arguments['modify'])) { return $this; } diff --git a/tests/Pest/ManagerTest.php b/tests/Pest/ManagerTest.php index 1773f76..8ce5154 100644 --- a/tests/Pest/ManagerTest.php +++ b/tests/Pest/ManagerTest.php @@ -78,3 +78,7 @@ test('thunks can be used as defaults', function () { expect(seo('title'))->toBe('bar'); }); + +test('setting the defaults returns the manager instance', function () { + expect(seo()->title(default: 'foo'))->toBeInstanceOf(SEOManager::class); +});