title: Events don't show in full calendar in laravel
body: <p>Please i need help , im working on open source project in laravel ,this is a booking room system , every thing working well but there is somthing in the full calendar script where i cant see the event that i have created , but when i vew source page i see the event correctly but its not show in calendar</p>
  
  <p>this is the booking index page with script code for full calendar:</p>
  
  <pre><code>@inject('request', 'Illuminate\Http\Request')
  @extends('layouts.app')
  
  @section('content')
      &lt;h3 class="page-title"&gt;@lang('quickadmin.bookings.title')&lt;/h3&gt;
      @can('booking_create')
      &lt;p&gt;
          &lt;a href="{{ route('admin.bookings.create') }}" class="btn btn-success"&gt;@lang('quickadmin.qa_add_new')&lt;/a&gt;
  
      &lt;/p&gt;
      @endcan
           &lt;link href='//fonts.googleapis.com/css?family=Lato:100,400,700' rel='stylesheet' /&gt;
          &lt;link href='https://fullcalendar.io/css/base.css?3.5.1-1.7.1-1' rel='stylesheet' /&gt;
          &lt;link rel='stylesheet' href='https://fullcalendar.io/js/fullcalendar-3.5.1/fullcalendar.min.css' /&gt;
  
  
      &lt;div id='calendar'&gt;&lt;/div&gt;
  
  @stop
  
  @section('javascript') 
    &lt;script src='https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js'&gt;&lt;/script&gt;
      &lt;script src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js'&gt;&lt;/script&gt;
      &lt;script src='https://fullcalendar.io/js/fullcalendar-3.5.1/fullcalendar.min.js'&gt;&lt;/script&gt;
      &lt;script src='https://fullcalendar.io/js/home.js?3.5.1-1.7.1-1'&gt;&lt;/script&gt;
  
      &lt;script&gt;
         $(document).ready(function(){
          $('#calendar').fullcalendar({
              defaultView: 'agendaWeek',
             editable: true,
             events:[
                  @foreach($bookings as $booking)
                  {
                      title:'{{$booking-&gt;room-&gt;name.' '.$booking-&gt;room-&gt;notes}}',    
                      start:'{{$booking-&gt;date.' '.$booking-&gt;start_time}}',
                      finish:'{{$booking-&gt;date.' '.$booking-&gt;finish_time}}',
                      url :'{{route('admin.bookings.edit',$booking-&gt;id)}}'    
                  },
                  @endforeach
                  ] 
          })
       });
  
      &lt;/script&gt;
  @endsection
  </code></pre>
  
  <p>this is the Booking Controller :</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers\Admin;
  
  use App\Booking;
  use Illuminate\Http\Request;
  use Illuminate\Support\Facades\Gate;
  use App\Http\Controllers\Controller;
  use App\Http\Requests\Admin\StoreBookingsRequest;
  use App\Http\Requests\Admin\UpdateBookingsRequest;
  
  class BookingsController extends Controller
  {
      /**
       * Display a listing of Booking.
       *
       * @return \Illuminate\Http\Response
       */
      public function index()
      {
          if (! Gate::allows('booking_access')) {
              return abort(401);
          }
  
  
          if (request('show_deleted') == 1) {
              if (! Gate::allows('booking_delete')) {
                  return abort(401);
              }
              $bookings = Booking::onlyTrashed()-&gt;get();
          } else {
              $bookings = Booking::all();
          }
  
          return view('admin.bookings.index', compact('bookings'));
      }
  
      /**
       * Show the form for creating new Booking.
       *
       * @return \Illuminate\Http\Response
       */
      public function create()
      {
          if (! Gate::allows('booking_create')) {
              return abort(401);
          }
  
          $rooms = \App\Room::get()-&gt;pluck('name', 'id')-&gt;prepend(trans('quickadmin.qa_please_select'), '');
  
          return view('admin.bookings.create', compact('rooms'));
      }
  
      /**
       * Store a newly created Booking in storage.
       *
       * @param  \App\Http\Requests\StoreBookingsRequest  $request
       * @return \Illuminate\Http\Response
       */
      public function store(StoreBookingsRequest $request)
      {
          if (! Gate::allows('booking_create')) {
              return abort(401);
          }
          $booking = Booking::create($request-&gt;all());
  
  
  
          return redirect()-&gt;route('admin.bookings.index');
      }
  
  
      /**
       * Show the form for editing Booking.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function edit($id)
      {
          if (! Gate::allows('booking_edit')) {
              return abort(401);
          }
  
          $rooms = \App\Room::get()-&gt;pluck('name', 'id')-&gt;prepend(trans('quickadmin.qa_please_select'), '');
  
          $booking = Booking::findOrFail($id);
  
          return view('admin.bookings.edit', compact('booking', 'rooms'));
      }
  
      /**
       * Update Booking in storage.
       *
       * @param  \App\Http\Requests\UpdateBookingsRequest  $request
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function update(UpdateBookingsRequest $request, $id)
      {
          if (! Gate::allows('booking_edit')) {
              return abort(401);
          }
          $booking = Booking::findOrFail($id);
          $booking-&gt;update($request-&gt;all());
  
  
  
          return redirect()-&gt;route('admin.bookings.index');
      }
  
  
      /**
       * Display Booking.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function show($id)
      {
          if (! Gate::allows('booking_view')) {
              return abort(401);
          }
          $booking = Booking::findOrFail($id);
  
          return view('admin.bookings.show', compact('booking'));
      }
  
  
      /**
       * Remove Booking from storage.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function destroy($id)
      {
          if (! Gate::allows('booking_delete')) {
              return abort(401);
          }
          $booking = Booking::findOrFail($id);
          $booking-&gt;delete();
  
          return redirect()-&gt;route('admin.bookings.index');
      }
  
      /**
       * Delete all selected Booking at once.
       *
       * @param Request $request
       */
      public function massDestroy(Request $request)
      {
          if (! Gate::allows('booking_delete')) {
              return abort(401);
          }
          if ($request-&gt;input('ids')) {
              $entries = Booking::whereIn('id', $request-&gt;input('ids'))-&gt;get();
  
              foreach ($entries as $entry) {
                  $entry-&gt;delete();
              }
          }
      }
  
  
      /**
       * Restore Booking from storage.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function restore($id)
      {
          if (! Gate::allows('booking_delete')) {
              return abort(401);
          }
          $booking = Booking::onlyTrashed()-&gt;findOrFail($id);
          $booking-&gt;restore();
  
          return redirect()-&gt;route('admin.bookings.index');
      }
  
      /**
       * Permanently delete Booking from storage.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function perma_del($id)
      {
          if (! Gate::allows('booking_delete')) {
              return abort(401);
          }
          $booking = Booking::onlyTrashed()-&gt;findOrFail($id);
          $booking-&gt;forceDelete();
  
          return redirect()-&gt;route('admin.bookings.index');
      }
  }
  </code></pre>
  
  <p>this is the Booking Model :</p>
  
  <pre><code>&lt;?php
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  use Carbon\Carbon;
  use Illuminate\Database\Eloquent\SoftDeletes;
  
  /**
   * Class Booking
   *
   * @package App
   * @property string $room
   * @property string $booking_name
   * @property string $start_time
   * @property string $finish_time
   * @property string $phone
   * @property string $email
   * @property string $notes
  */
  class Booking extends Model
  {
      use SoftDeletes;
  
      protected $fillable = ['booking_name', 'start_time', 'finish_time', 'phone', 'email', 'notes', 'room_id'];
  
  
      /**
       * Set to null if empty
       * @param $input
       */
      public function setRoomIdAttribute($input)
      {
          $this-&gt;attributes['room_id'] = $input ? $input : null;
      }
  
      /**
       * Set attribute to date format
       * @param $input
       */
      public function setStartTimeAttribute($input)
      {
          if ($input != null &amp;&amp; $input != '') {
              $this-&gt;attributes['start_time'] = Carbon::createFromFormat(config('app.date_format') . ' H:i:s', $input)-&gt;format('Y-m-d H:i:s');
          } else {
              $this-&gt;attributes['start_time'] = null;
          }
      }
  
      /**
       * Get attribute from date format
       * @param $input
       *
       * @return string
       */
      public function getStartTimeAttribute($input)
      {
          $zeroDate = str_replace(['Y', 'm', 'd'], ['0000', '00', '00'], config('app.date_format') . ' H:i:s');
  
          if ($input != $zeroDate &amp;&amp; $input != null) {
              return Carbon::createFromFormat('Y-m-d H:i:s', $input)-&gt;format(config('app.date_format') . ' H:i:s');
          } else {
              return '';
          }
      }
  
      /**
       * Set attribute to date format
       * @param $input
       */
      public function setFinishTimeAttribute($input)
      {
          if ($input != null &amp;&amp; $input != '') {
              $this-&gt;attributes['finish_time'] = Carbon::createFromFormat(config('app.date_format') . ' H:i:s', $input)-&gt;format('Y-m-d H:i:s');
          } else {
              $this-&gt;attributes['finish_time'] = null;
          }
      }
  
      /**
       * Get attribute from date format
       * @param $input
       *
       * @return string
       */
      public function getFinishTimeAttribute($input)
      {
          $zeroDate = str_replace(['Y', 'm', 'd'], ['0000', '00', '00'], config('app.date_format') . ' H:i:s');
  
          if ($input != $zeroDate &amp;&amp; $input != null) {
              return Carbon::createFromFormat('Y-m-d H:i:s', $input)-&gt;format(config('app.date_format') . ' H:i:s');
          } else {
              return '';
          }
      }
  
      public function room()
      {
          return $this-&gt;belongsTo(Room::class, 'room_id')-&gt;withTrashed();
      }
  
  }
  </code></pre>
  
  <p>this is the route of booking:</p>
  
  <pre><code>Route::resource('bookings', 'Admin\BookingsController');
      Route::post('bookings_mass_destroy', ['uses' =&gt; 'Admin\BookingsController@massDestroy', 'as' =&gt; 'bookings.mass_destroy']);
      Route::post('bookings_restore/{id}', ['uses' =&gt; 'Admin\BookingsController@restore', 'as' =&gt; 'bookings.restore']);
      Route::delete('bookings_perma_del/{id}', ['uses' =&gt; 'Admin\BookingsController@perma_del', 'as' =&gt; 'bookings.perma_del']);
  </code></pre>
  
  <p>UPDATED</p>
  
  <p>and this is the result that i show when view page source:</p>
  
  <pre><code> &lt;script&gt;
         $(document).ready(function(){
          $('#calendar').fullcalendar({
              defaultView: 'agendaWeek',
             events:[
                                  {
                      title:'room one hy',    
                      start:' 15-09-2017 06:00:00',
                      finish:' 16-09-2017 09:00:00',
                      url :'http://127.0.0.1:8000/admin/bookings/5/edit'    
                  },
                                  {
                      title:'room one hy',    
                      start:' 13-09-2017 07:00:00',
                      finish:' 13-09-2017 10:00:00',
                      url :'http://127.0.0.1:8000/admin/bookings/6/edit'    
                  },
                                  {
                      title:'room one hy',    
                      start:' 27-09-2017 07:11:00',
                      finish:' 29-09-2017 09:13:00',
                      url :'http://127.0.0.1:8000/admin/bookings/7/edit'    
                  },
                                  {
                      title:'room one hy',    
                      start:' 27-09-2017 07:00:00',
                      finish:' 30-09-2017 08:00:00',
                      url :'http://127.0.0.1:8000/admin/bookings/8/edit'    
                  },
                                  {
                      title:'room one hy',    
                      start:' 04-10-2017 04:00:00',
                      finish:' 04-10-2017 09:00:00',
                      url :'http://127.0.0.1:8000/admin/bookings/9/edit'    
                  },
                                  ] 
          })
       });
  </code></pre>