laravel-async
laravel-async copied to clipboard
Non-static method 'run' should not be called statically error
I'm unable to execute the first code from the readme, it says that I cannot execute the run method
Check the screenshot above
I'm using Laravel 8 and PHP 7
Have you import Async fadecade?
<?php
use Async;
Yeah, did that, did the publish config, everything.
And still same error.
Look like you are using VXM\Async\Async
, could you show me first few lines of your PHP file?
Same issue for me. I included use Async, but it didn't fine the Async class. Have you found a solution @saulob?
Sorry @CheeseTastisch, no luck here. I removed it, stopped using it :(
Hey @saulob.
For me it worked fine, as i installed the ide-helper package and execute the command php artisan ide:helper:generate
.
I hope this can fix it for you as well.
I was able to register it manually (since it was being registered automatically):
$app->register(VXM\Async\AsyncServiceProvider::class);
That resolved this issue, only to throw another error Call to undefined function VXM\\Asyn= c\\config_path()
. I can't think of a way where registering it like that would cause this error.
Any updates on this issue?
@parsasi @lukasmedia
As i said in the answer before, it's working perfect, if you install ide-helper and run php artisan ide-helper:generate
.
Than import the Async Trait (not use VXM\Async\Async
but use Async
).
Hi @vuongxuongminh this is my code already implemented and followed your documentation step by step, but I experienced some errors at code editor.
Are you able to guide me, please? on how to use the function with use Async
Screenshot:
Use VXM\Async\AsyncFacade as Async;
instead.