Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MazQue's avatar

Adding facades to custom php file

Hello forum. I have just joined LaraCast, and got to say it is amazing! So this will be my first question, and i hope some lovely guy or girl might be able to help me out with this little pickle of mine.

I have a custom .php file in my project (app\Folder\File.php), it is running a while loop, doing some stuff every 30 seconds. I am running it from my terminal using the

php -q app/Folder/File.php

But i want to be able to access facades in there, like Auth::, Redis:: and other stuff. I have no idea how to declare this properly, as i keep getting a "A facade root has not been set" error, when using the following:

use Illuminate\Support\Facades\Redis as Redis;

Any help would really be appreciated on this!

0 likes
2 replies

Please or to participate in this conversation.