jeudi 3 décembre 2020

How do I dynamically chain a function in Larevel?

In my Laravel Scheduler

protected function schedule(Schedule $schedule)
{

    if(env('APP_DEBUG') == true){
        $cronInterval = 'everyMinute()';
    } else {
        $cronInterval = 'daily()';
    }


    $schedule->command('inspire')
            ->$cronInterval
            ->emailOutputTo(env('MAIL_TO')); // tried 

How do I dynamically chain a function in Larevel ?

enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire