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

36 lines
668 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()
{
$data = [
2017-09-13 10:56:26 +02:00
'account' => auth()->user()->account,
2017-09-12 12:43:59 +02:00
];
return view('calendar', $data);
}
public function loadEvents()
{
2017-09-13 10:56:26 +02:00
if (auth()->user()->account->hasFeature(FEATURE_REPORTS)) {
$events = dispatch(new GenerateCalendarEvents());
} else {
$events = [];
}
2017-09-12 12:43:59 +02:00
return response()->json($events);
}
}