fullcalendar - 在 Laravel 应用程序中显示 Google 日历
问题描述
我正在尝试在 Laravel 应用程序中显示 Google 日历。我可以使用这个包获取谷歌日历。
如何显示如下日历?
谢谢@Prisoner。我在控制器中使用了以下代码。
<?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);
return view('welcome', compact('calendar'));
}
}
但我得到白屏。
解决方案
推荐阅读
- java - 在不同的活动中显示列表视图
- html - 难以解决我网页下方的空白
- java - DTO 到 BeanWrapperImpl
- jquery - 带角的 jQueryUI 可拖动棒
- java - Java 卷积(数组超出索引错误)
- r - 如何使数据“混乱”?
- javascript - 在 OpenLayers 6 中结合 ImageLayer 和 VectorLayer
- flutter - Flutter Flex() 如何交换子位置?
- spring-cloud - Spring Cloud 更新到 2.2.2 导致没有 RefreshEndpoint 类型的合格 bean
- javascript - 如何从基于常规 html/js 的应用程序调用节点应用程序?