app/Console/Commands/VisitasProximasCommand.php
/**
     * Execute the console command.
     *
     * @return mixed
     */
Execute the console command.
@return mixed
Execute the console command . @return mixed
public function handle()
    {
        $visitas = Visita::whereBetween('fecha_inicio', [Carbon::now()->toDateTimeString(),Carbon::now()->addMinutes(15)->toDateTimeString()])->whereIn('estado_visita_id', [1,2,3,4])->get();
        foreach ($visitas as $visita) {
            $visita->vendedor->notify(new VisitaProximaNotification($visita->id));
        }
    }
public function handle ( ) { $ visitas = Visita :: whereBetween ( 'fecha_inicio' , [ Carbon :: now ( ) -> toDateTimeString ( ) , Carbon :: now ( ) -> addMinutes ( 15 ) -> toDateTimeString ( ) ] ) -> whereIn ( 'estado_visita_id' , [ 1 , 2 , 3 , 4 ] ) -> get ( ) ; foreach ( $ visitas as $ visita ) { $ visita -> vendedor -> notify ( new VisitaProximaNotification ( $ visita -> id ) ) ; } }
Execute the console command.
Execute the console command .