mardi 18 juillet 2017

Laravel model:all, use results (collection) in the same function

I am retrieving events from DirtyEvent model and I want to create an Ical using the values from the results however it says that the values do not exist in currect collection:

public function handle()
{
    $event = DirtyEvent::all()
            ->pluck('startdate')
            ->pluck('endate');
    dd($event);
    $vCalendar = new \Eluceo\iCal\Component\Calendar('http://localhost/test');
    $vEvent = new \Eluceo\iCal\Component\Event();
    $vEvent ->setDtStart(new \DateTime($event->startdate))
            ->setDtEnd(new \DateTime($event->endate));
    $vCalendar->addComponent($vEvent);
    dd($vCalendar);
}



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2vcXBXA
via IFTTT

Aucun commentaire:

Enregistrer un commentaire