unicodeveloper / laravel-paystack

:credit_card: :package: :moneybag: Laravel 6, 7, 8, 9, 10 and 11 Package for Paystack
https://paystack.co
MIT License
615 stars 313 forks source link

Undefined type 'Unicodeveloper\Paystack\Facades\Paystack' #168

Closed iampapagray closed 1 year ago

iampapagray commented 1 year ago

Thank you for this library.

I'm using this on Laravel 9. i added 'Paystack' => Unicodeveloper\Paystack\Facades\Paystack::class, to my config/app.php in the aliases array like so:

'aliases' => Facade::defaultAliases()->merge([
        'Carbon' => Illuminate\Support\Carbon::class,
        'Paystack' => Unicodeveloper\Paystack\Facades\Paystack::class,
    ])->toArray(),

However, in my controller when i do Paystack::getAllCustomers() VSCode underlines Paystack. And intelliphense gives error message as Undefined type 'Unicodeveloper\Paystack\Facades\Paystack'

Is there something i'm missing? Kindly help

goodmuyis commented 1 year ago

Your controller is missing **use Paystack;** at the top

ucodetech commented 1 year ago

I'm having same issues here even when i have referenced the use Paystack at the top

goodmuyis commented 1 year ago

I'm having same issues here even when i have referenced the use Paystack at the top

Did you...

Also, register the Facade like so:

'aliases' => [
    ...
    'Paystack' => Unicodeveloper\Paystack\Facades\Paystack::class,
    ...
]
ucodetech commented 1 year ago

It's working now thanks

On Sat, Sep 9, 2023, 1:59 AM goodmuyis @.***> wrote:

I'm having same issues here even when i have referenced the use Paystack at the top

Did you...

Also, register the Facade like so:

'aliases' => [ ... 'Paystack' => Unicodeveloper\Paystack\Facades\Paystack::class, ... ]

— Reply to this email directly, view it on GitHub https://github.com/unicodeveloper/laravel-paystack/issues/168#issuecomment-1712368178, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP44RN67FDW6FAFAKMQLCWDXZO5NXANCNFSM6AAAAAAU73VFLE . You are receiving this because you commented.Message ID: @.***>