1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-15 23:52:33 +01:00
invoiceninja/app/Http/Controllers/CalendarController.php

41 lines
871 B
PHP
Raw Normal View History

2017-09-12 12:43:59 +02:00
<?php
namespace App\Http\Controllers;
use App\Jobs\GenerateCalendarEvents;
/**
* Class ReportController.
*/
class CalendarController extends BaseController
{
/**
* @return \Illuminate\Contracts\View\View
*/
public function showCalendar()
{
if (! auth()->user()->hasPermission('view_all')) {
return redirect('/');
}
$data = [
//'showBreadcrumbs' => false,
];
return view('calendar', $data);
}
public function loadEvents()
{
$events = dispatch(new GenerateCalendarEvents());
//dd($events);
\Log::info(print_r(request()->input(), true));
\Log::info(print_r($events, true));
//echo '[{"title": "Test Event", "start": "2017-09-14T16:00:00", "color": "green"}]';
//exit;
return response()->json($events);
}
}