OrderHosting Posted July 10, 2023 Share Posted July 10, 2023 Every day, running the CRON, this warning comes out via email, can someone help me how to eliminate this error? Thank you Nicola Elefante In ForwardsCalls.php line 50: Call to undefined method Illuminate\Database\Query\Builder::lists() all [-F|--force] [--email-report [EMAIL-REPORT]] 0 Quote Link to comment Share on other sites More sharing options...
Billy Goddard Posted July 14, 2023 Share Posted July 14, 2023 On 7/10/2023 at 2:28 PM, OrderHosting said: Every day, running the CRON, this warning comes out via email, can someone help me how to eliminate this error? Thank you Nicola Elefante In ForwardsCalls.php line 50: Call to undefined method Illuminate\Database\Query\Builder::lists() mcdvoice all [-F|--force] [--email-report [EMAIL-REPORT]] Hello, The error message suggests that there is a call to the undefined method lists() in the file ForwardsCalls.php at line 50. This method is not available in the IIIuminate \Database\Query\Builder class. You may need to update your code to use a different method or check for any typos or incorrect method names. 0 Quote Link to comment Share on other sites More sharing options...
foxdealer Posted August 11, 2023 Share Posted August 11, 2023 Based on the error message provided, it appears that there is an issue with the lists() method in the Illuminate\Database\Query\Builder class. This method has been deprecated in recent versions of Laravel and should be replaced with the pluck() method instead. To eliminate this error, you will need to update the code in the ForwardsCalls.php file to use the pluck() method instead of lists(). Here's an example of how to do this: // Replace this line: $users = DB::table('users')->where('active', 1)->lists('name'); // With this line: $users = DB::table('users')->where('active', 1)->pluck('name'); Once you have made this change, the error should no longer occur when running the CRON job. If you continue to experience issues, you may need to check the rest of your codebase for any other instances of the lists() method and replace them with pluck() as well. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.