Jump to content

Error "Cron <orderhosting@orderhosting> (/opt/plesk/php/7.4/bin/php -f '/var/www/vhosts/orderhosting.it/crons/cron.php') > /dev/null "


OrderHosting

Recommended Posts

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]]
Link to comment
Share on other sites

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. 

 

 

Link to comment
Share on other sites

  • 4 weeks later...

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated