Artisans! I have a question.
In a package I'm creating the current way for using the class is by first using the Quickpay::api() method, and then tacking on any other method.
How could I change my code to skip this Quickpay::api()->payments()->create() and just go directly to Quickpay::payments()->create();
github.com/mortenebak/laravel-quickpay
Any help appriciated :)
Back
Or you can use laravel idea for phpstorm (it costs a bit)
Or try this github.com/barryvdh/laravel-ide-helper
But as it's a package you should do the first one :)
•
Well. Thats kinda what I want to do, but struggling to grasp how 🫣
•
In response to @mortenebak
It should just work :) Just be sure you use the facade and not the actual implementation class
\Netbums\Quickpay\Facades\Quickpay::payments()->create();
•
Thanks 👍 Next question that arises is the lack of autocomplete og methods 🫣
•
You add them in a php doc in the facade file. Open any laravel facade file to see how they do it github.com/laravel/framework/blob/b9cf7d3217732e9a0fa4f00e996b3f9cc5bf7abd/src/Illuminate/Support/Facades/Storage.php#L8
Or you can use laravel idea for phpstorm (it costs a bit)
Or try this github.com/barryvdh/laravel-ide-helper
But as it's a package you should do the first one :)