Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how i can send by database table in laravel full calendar

namespace AppHttpControllers;

use IlluminateHttpRequest;
use Calendar;
use AppEvent;

class EventController extends Controller
{
    public function index()
    {
        $events = [];
        $data = Event::all();
        if($data->count()) {
            foreach ($data as $key => $value) {
                $events[] = Calendar::event(
                    $value->title,
                    true,
                    new DateTime($value->start_date),
                    new DateTime($value->end_date.' +1 day'),
                    null,
                    // Add color and link on event
                    [
                        'color' => '#f05050',
                        'url' => 'pass here url and any route',
                    ]
                );
            }
        }
        $calendar = Calendar::addEvents($events);
        return view('fullcalendar', compact('calendar'));
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #send #database #table #laravel #full #calendar
ADD COMMENT
Topic
Name
8+3 =