Reputation: 7062
I am trying to display Google Calendar in Laravel application. I can fetch Google Calendar using this package. I am trying to display calendar using this package.
My controller code is like below
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
use Spatie\GoogleCalendar\Event;
use Calendar;
class HomeController extends BaseController
{
public function calendar() {
$events = [];
$data = Event::get();
if($data->count()){
foreach ($data as $key => $value) {
$events[] = Calendar::event(
$value->name,
true,
new \DateTime($value->startDate),
new \DateTime($value->endDate.' +1 day')
);
}
}
$calendar = Calendar::addEvents($events);
//dd($calendar);
return view('welcome', compact('calendar'));
}
}
If I dd()
I can get below data.
My view files code is like below
<!doctype html>
<html lang="en">
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.2.7/fullcalendar.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.2.7/fullcalendar.min.css" />
</head>
<body>
{!! $calendar->calendar() !!}
{!! $calendar->script() !!}
</body>
</html>
But I am getting white blank screen.
I used below codes in public/index.php
file.
error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
ini_set("display_errors", 1);
But I am not getting any error.
There is no error in storage/laravel.log
file also.
I am getting below situation when I go to console.
Upvotes: 1
Views: 266
Reputation: 74
Something similar appended to me recently. Turned out I had error reporting turned off somewhere else in the code. Do search for any of those in case.
error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
ini_set("display_errors", 1);
Upvotes: 2