We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f076557 + 7f2dfcb commit 10c5a42Copy full SHA for 10c5a42
src/ResponseFactory.php
@@ -5,10 +5,13 @@
5
use Closure;
6
use Illuminate\Support\Arr;
7
use Illuminate\Support\Facades\App;
8
+use Illuminate\Support\Traits\Macroable;
9
use Illuminate\Contracts\Support\Arrayable;
10
11
class ResponseFactory
12
{
13
+ use Macroable;
14
+
15
protected $rootView = 'app';
16
protected $sharedProps = [];
17
protected $version = null;
tests/ResponseFactoryTest.php
@@ -0,0 +1,18 @@
1
+<?php
2
3
+namespace Inertia\Tests;
4
+use Inertia\ResponseFactory;
+class ResponseFactoryTest extends TestCase
+{
+ public function test_can_macro()
+ {
+ $factory = new ResponseFactory();
+ $factory->macro('foo', function () {
+ return 'bar';
+ });
+ $this->assertEquals('bar', $factory->foo());
+ }
18
+}
0 commit comments