1 month ago

Blank white screen in Google Calender

Posted 1 month ago by afoysal

I am trying to display Google Calendar in Laravel application. I can fetch Google Calendar using this package.

My controller code is like below


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();

            foreach ($data as $key => $value) {
                $events[] = Calendar::event(
                    new \DateTime($value->startDate),
                    new \DateTime($value->endDate.' +1 day')
        $calendar = Calendar::addEvents($events);


        return view('welcome', compact('calendar'));

If I dd() I can get below data.

enter image description here

My view files code is like below

<!doctype html>
<html lang="en">

    <script src="//"></script>
    <script src="//"></script>
    <script src="//"></script>
    <link rel="stylesheet" href="//" />

    {!! $calendar->calendar() !!}
    {!! $calendar->script() !!}


But I am getting white blank screen.

I used below codes in public/index.php file.

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.

enter image description here

Please sign in or create an account to participate in this conversation.