1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00
invoiceninja/app/Http/Controllers/CalendarController.php
2019-09-12 19:30:10 -04:00

37 lines
720 B
PHP

<?php
namespace App\Http\Controllers;
use App\Jobs\GenerateCalendarEvents;
/**
* Class ReportController.
*/
class CalendarController extends BaseController
{
/**
* @return \Illuminate\Contracts\View\View
*/
public function showCalendar()
{
$data = [
'title' => trans('texts.calendar'),
'account' => auth()->user()->account,
];
return view('calendar', $data);
}
public function loadEvents()
{
if (auth()->user()->account->hasFeature(FEATURE_REPORTS)) {
$events = dispatch_now(new GenerateCalendarEvents());
} else {
$events = [];
}
return response()->json($events);
}
}