parallel icon indicating copy to clipboard operation
parallel copied to clipboard

[BUG/QUESTION] How does one use Laravel's facades inside a Task?

Open ThaDaVos opened this issue 5 years ago • 6 comments

I'm currently trying to use Laravel's Storage facade inside my custom task as I have to download and save multiple files to disk. But I'm running into an issue as I get the error A facade root has not been set

Are there any know solutions for this?

ThaDaVos avatar Jun 02 '20 13:06 ThaDaVos

You'll have to configure anything in the worker again, because objects are serialized and sent to another process.

kelunik avatar Jun 04 '20 07:06 kelunik

Any guide on how? I couldn't find any guides from Laravel on how to manually configure everything again

ThaDaVos avatar Jun 04 '20 09:06 ThaDaVos

How do you bootstrap your initial script? Do you include certain files?

trowski avatar Jun 04 '20 15:06 trowski

I don't really know, it's a Laravel project and it bootstraps a lot - but I don't know exactly what

ThaDaVos avatar Jun 04 '20 16:06 ThaDaVos

Any solution? I have the same problem

DakingRT avatar Dec 15 '21 12:12 DakingRT

We're both not using Laravel, so this has to be answered by somebody from the Laravel community.

kelunik avatar Dec 15 '21 13:12 kelunik