If this does not work for any reason you should get an error code in your error tracking system or in storage/logs where you see the info message. The other reason might be because you don't have any model requests with that status in your production database.
Laravel command fails on cPanel only
Hey guys, I have a command where I find some models and send emails. I'm not gonna post the whole code but simply it looks like this.
Log::info('Daily Late Requests Check Executed!');
$newRequests=ModelsRequest::where("status","pending")->get();
foreach ($newRequests as $request){
Http::get('url', [
//parameters//
]);
Mail::to($request->donorEmail)->send(new donorLateReq([
//parameters//
]));
}
I have added this command on Kernal.php and this works fine when I run php artisan schedule:run on my localhost.
But on my cpanel it only executes this line.
Log::info('Daily Late Requests Check Executed!');
I guess this line can't be executed on cpanel.
ModelsRequest::where("status","pending")->get();
All models are working fine on every controller. The whole app works fine on cpanel except this scheduled command.
I tried sending an email, sending an sms using this scheduled command and those worked fine.
Anyone knows how to fix this on cPanel?
Thanks!
Please or to participate in this conversation.