diff --git a/src/Illuminate/Config/Repository.php b/src/Illuminate/Config/Repository.php index 4a28b2ff3793..640d6731bc27 100644 --- a/src/Illuminate/Config/Repository.php +++ b/src/Illuminate/Config/Repository.php @@ -5,9 +5,12 @@ use ArrayAccess; use Illuminate\Contracts\Config\Repository as ConfigContract; use Illuminate\Support\Arr; +use Illuminate\Support\Traits\Macroable; class Repository implements ArrayAccess, ConfigContract { + use Macroable; + /** * All of the configuration items. * diff --git a/tests/Config/RepositoryTest.php b/tests/Config/RepositoryTest.php index d64bbb6063e2..5a46da60bb7a 100644 --- a/tests/Config/RepositoryTest.php +++ b/tests/Config/RepositoryTest.php @@ -217,4 +217,13 @@ public function testOffsetUnset() $this->assertArrayHasKey('associate', $this->repository->all()); $this->assertNull($this->repository->get('associate')); } + + public function testsItIsMacroable() + { + $this->repository->macro('foo', function () { + return 'macroable'; + }); + + $this->assertSame('macroable', $this->repository->foo()); + } }