Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Try like this:
app('App\Http\Controllers\PrintReportController')->getPrintReport();
Separate the code that does something in the controller method into a separate class, for example, in the App\Services namespace, which you put in the app\Services folder. Include it in both the controller constructor and the command constructor. And call the desired method with this functionality both in the controller and in the command.
All other methods, such as, God forgive me, calling a GET request from cron, are hellish shit code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question