How to implement jQuery fullcalendar in laravel 5.5

Image for post
Image for post
Image for post
Image for post

In this post we are share with you how to implement full calendar (JavaScript Event Calendar) in laravel 5.5. for use full calendar we will represent our daily tasks, events and schedule one daily basis and also start date to end date.

in this post I’ve show how to install and implement basic example for full calendar with dummy data .

After completed this tutorials your output look like this.

Image for post
Image for post

Install Fullcalendar package

composer require maddhatter/laravel-fullcalendar

next register in app.php

Image for post
Image for post

Event table

php artisan make:migration create_events_table

open file and fill in function up with

        Schema::create('events', function (Blueprint $table) {

save and run

php artisan migrate

insert seed data with seeder

php artisan make:seeder AddDummyEvent

open AddummyEvent.php

<?phpuse Illuminate\Database\Seeder;class AddDummyEvent extends Seeder
* Run the database seeds.
* @return void
public function run()

$data = [
['title'=>'Finacial forum', 'start_date'=>'2017-10-12', 'end_date'=>'2017-09-15'],
['title'=>'Devtalk', 'start_date'=>'2017-10-13', 'end_date'=>'2017-09-25'],
['title'=>'Super Event', 'start_date'=>'2017-09-23', 'end_date'=>'2017-09-24'],
['title'=>'wtf event', 'start_date'=>'2017-09-19', 'end_date'=>'2017-09-27'],

save and run

php artisan db:seed --class=AddDummyEvent

now we have dummy data

Image for post
Image for post

Event Model

php artisan make:model Event

next insert fillable

<?phpnamespace App;use Illuminate\Database\Eloquent\Model;class Event extends Model
protected $fillable = ['title','start_date','end_date'];

Event Controller

php artisan make:controlelr EventController

open file and copy code below and paste

<?phpnamespace App\Http\Controllers;use Illuminate\Http\Request;
use App\Event;
use MaddHatter\LaravelFullcalendar\Facades\Calendar;
class EventController extends Controller
public function index()
$events = [];
$data = Event::all();
if($data->count()) {
foreach ($data as $key => $value) {
$events[] = Calendar::event(
new \DateTime($value->start_date),
new \DateTime($value->end_date.' +1 day'),
// Add color and link on event
'color' => '#ff0000',
'url' => 'pass here url and any route',
$calendar = Calendar::addEvents($events);
return view('fullcalender', compact('calendar'));

first we include Event model and Calendar class and fetch data with loop and make it compatible for fullcalendar and send complete object to fullcalendar view with compact

Event view

<!doctype html>
<html lang="{{ app()->getLocale() }}">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Fonts -->
<link href=",600" rel="stylesheet" type="text/css">

<script src=""></script>

next create fullcalendar.blade.php and copy code and paste

<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" href=""/>
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Full Calendar Example</div>
<div class="panel-body">
{!! $calendar->calendar() !!}
<script src=""></script>
<script src=""></script>
{!! $calendar->script() !!}

last we bridge controller and view with route

Route::get('events', 'EventController@index');

save and goto


hope you see result that work

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store