Laravel

  Sun 11 / 06 / 2023

  Posted by: Ahad Ali

Category : Laravel

Tags : laravel , php laravel

Post Thumbnail
Description

I am making an investment platform where people can get their profit daily so Is there any Laravel function that can auto-add profit to the customer table without any admin need? 

I think Laravel scheduler can do this or is there any solution kindly guide me.  

Bhai ma na is pa work kia hn or app ko live b kia hostinger pa testing ka lia lakin jab server pr cron job add krta hn to path ka issue a raha hn kafi try kia lakin sahi tarah add nahi huva


  Answered by CDL

it's your custom logic so you want to execute tasks daily so the cron job is the right choice to do it daily whatever you want to do.

Generate new command and then define your logic handle method inside the newly created class.

~~~

public function handle()

{

// info('demo');

}

~~~

and then go to the console/kernel.php and call your command inside the schedule method

~~~

protected function schedule(Schedule $schedule)

{

   $schedule->command('database:backup')->daily();

}

~~~

  Comment   Share
0 Likes   1 Comment


comment-author
Ahad Ali Author

Bhai ma na is pa work kia hn or app ko live b kia hostinger pa testing ka lia lakin jab server pr cron job add krta hn to path ka issue a raha hn kafi try kia lakin sahi tarah add nahi huva



Reply


commented 1 year ago
comment-author
Hadayat Niazi Super Admin

Jab ap hostinger ke andar ssh se connect hoty hain uske 2 bar public_html ke andar jana prta hai, ye sirf hostinger ki configuration hai. Ap connect huey ssh se then apne cd public_html krna hai aur uske baad phir cd public_html krna hai then apka control root dir mein aye ga, aur ap verify kr skty hain k ap konsy folder mein mojod hain ls command se.