Please show the register() of your service provider which registers the facade.
my facade doesn't work in console command
I have a custom facade that works just fine in my controllers and models, but doesn't work in any artisan console command.
When using the normal "use" statement that works everywhere else ("use App\Facades\ITwrx\ITwrxCrypt;") in any console command, i get "A facade root has not been set.", but if i use the following path "use Facades\App\Facades\ITwrx\ITwrxCrypt;"(i don't understand why it needs to start with "Facades" when using from the console) or if i inject the facade into the handler using various methods, the latest being "$ITwrxCrypt = resolve('App\Facades\ITwrx\ITwrxCrypt');" and try to use the facade with "$ITwrxCrypt->decrypt(str_replace('ELOCRYPT', '', $value));" or "$value = ITwrxCrypt::decrypt(str_replace('ELOCRYPT', '', $value));", depending on which method i used above, i get "Call to undefined method App\Facades\ITwrx\ITwrxCrypt::decrypt()". So, to me, it seems the injection is working for my facade, but it doesn't "see" the base class my facade is extending. Maybe i'm being tricked though...
A little context: My ITwrxCrypt facade points to my custom service provider that extends laravel's encrypter class (class ITwrxEncryptionServiceProvider extends \Illuminate\Encryption\EncryptionServiceProvider). The "decrypt" method that is not being found is in laravel's "encrypter" class that my custom ITwrx_encrypter class is extending. Everywhere besides a console command, the same exact code with the decrypt method works fine.
how to get my artisan/console command to be able to use my facade (and the methods in the base class that it extends) like it does everywhere else?
If i need to pastebin the various pieces i can do that i was just trying to keep the verbosity under control.
thanks
@itwrx possible to paste the full codes? offhand, I can tell that boot() is missing from the service provider.
It might be something else other than what you showed that cause the issue.
Please or to participate in this conversation.