Skip to content

Commit 355b26b

Browse files
authored
🔧 Fix default driver mixin issue (LaraCrafts#37)
1 parent b2f2f65 commit 355b26b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎src/UrlShortenerManager.php

+15
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
use LaraCrafts\UrlShortener\Http\ShorteStShortener;
1818
use LaraCrafts\UrlShortener\Http\TinyUrlShortener;
1919

20+
/**
21+
* @method string shorten(\Psr\Http\Message\UriInterface|string $url, array $options = [])
22+
*/
2023
class UrlShortenerManager implements FactoryContract
2124
{
2225
protected $app;
@@ -36,6 +39,18 @@ public function __construct(Application $app)
3639
$this->shorteners = [];
3740
}
3841

42+
/**
43+
* Dynamically call the default driver instance.
44+
*
45+
* @param string $method
46+
* @param array $parameters
47+
* @return mixed
48+
*/
49+
public function __call($method, $parameters)
50+
{
51+
return $this->driver()->$method(...$parameters);
52+
}
53+
3954
/**
4055
* Call a custom driver creator.
4156
*

0 commit comments

Comments
 (0)