php - How to Generate Monthly and Yearly Recuring Invoice in Laravel -


i doing invoice application in laravel. in application, users can create recurring profiles. profiles automatically generated invoices monthly or yearly based on invoice date. want know how task, can give suggestions?

what do: when user creates recurring profile, save next recurring date in recurring profile table. every time generate invoice based on next recurring date. in process have following problem, user deactivate profile , again activate after 2 months, invoice cannot generated.

open kernal.php file in app->console folder

protected function schedule(schedule $schedule)     {         $schedule->call(function () {            //code         })->monthly();          $schedule->call(function () {            //code         })->yearly();          //this following code execute task on last day of every month          $schedule->call(function () {            //code         })->when(function () {                 return \carbon\carbon::now()->endofmonth()->istoday();                 });     } 

in schedule method, write code inside anonymous function , use monthly() , yearly() function trigger method every month , year automatically.

more information here https://laravel.com/docs/5.4/scheduling#schedule-frequency-options


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -