mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
37 lines
720 B
PHP
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);
|
|
}
|
|
|
|
}
|