1 | <?php |
||
19 | class TenantsController extends AuthorizedController |
||
20 | { |
||
21 | /** |
||
22 | * {@inheritdoc} |
||
23 | */ |
||
24 | protected $resource = Tenant::class; |
||
25 | |||
26 | /** |
||
27 | * List all tenants. |
||
28 | * |
||
29 | * @param \Cortex\Tenants\DataTables\Adminarea\TenantsDataTable $tenantsDataTable |
||
30 | * |
||
31 | * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View |
||
32 | */ |
||
33 | public function index(TenantsDataTable $tenantsDataTable) |
||
39 | |||
40 | /** |
||
41 | * List tenant logs. |
||
42 | * |
||
43 | * @param \Cortex\Tenants\Models\Tenant $tenant |
||
44 | * @param \Cortex\Foundation\DataTables\LogsDataTable $logsDataTable |
||
45 | * |
||
46 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
|
|||
47 | */ |
||
48 | public function logs(Tenant $tenant, LogsDataTable $logsDataTable) |
||
49 | { |
||
50 | return $logsDataTable->with([ |
||
51 | 'resource' => $tenant, |
||
52 | 'tabs' => 'adminarea.tenants.tabs', |
||
53 | 'id' => "adminarea-tenants-{$tenant->getRouteKey()}-logs-table", |
||
54 | ])->render('cortex/foundation::adminarea.pages.datatable-tab'); |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Import tenants. |
||
59 | * |
||
60 | * @param \Cortex\Tenants\Models\Tenant $tenant |
||
61 | * @param \Cortex\Foundation\DataTables\ImportRecordsDataTable $importRecordsDataTable |
||
62 | * |
||
63 | * @return \Illuminate\View\View |
||
64 | */ |
||
65 | public function import(Tenant $tenant, ImportRecordsDataTable $importRecordsDataTable) |
||
74 | |||
75 | /** |
||
76 | * Stash tenants. |
||
77 | * |
||
78 | * @param \Cortex\Foundation\Http\Requests\ImportFormRequest $request |
||
79 | * @param \Cortex\Foundation\Importers\DefaultImporter $importer |
||
80 | * |
||
81 | * @return void |
||
82 | */ |
||
83 | public function stash(ImportFormRequest $request, DefaultImporter $importer) |
||
89 | |||
90 | /** |
||
91 | * Hoard tenants. |
||
92 | * |
||
93 | * @param \Cortex\Foundation\Http\Requests\ImportFormRequest $request |
||
94 | * |
||
95 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
96 | */ |
||
97 | public function hoard(ImportFormRequest $request) |
||
120 | |||
121 | /** |
||
122 | * List tenant import logs. |
||
123 | * |
||
124 | * @param \Cortex\Foundation\DataTables\ImportLogsDataTable $importLogsDatatable |
||
125 | * |
||
126 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
127 | */ |
||
128 | public function importLogs(ImportLogsDataTable $importLogsDatatable) |
||
136 | |||
137 | /** |
||
138 | * Show tenant create/edit form. |
||
139 | * |
||
140 | * @param \Cortex\Tenants\Models\Tenant $tenant |
||
141 | * |
||
142 | * @return \Illuminate\View\View |
||
143 | */ |
||
144 | protected function form(Tenant $tenant) |
||
159 | |||
160 | /** |
||
161 | * Store new tenant. |
||
162 | * |
||
163 | * @param \Cortex\Tenants\Http\Requests\Adminarea\TenantFormRequest $request |
||
164 | * @param \Cortex\Tenants\Models\Tenant $tenant |
||
165 | * |
||
166 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
167 | */ |
||
168 | public function store(TenantFormRequest $request, Tenant $tenant) |
||
172 | |||
173 | /** |
||
174 | * Update given tenant. |
||
175 | * |
||
176 | * @param \Cortex\Tenants\Http\Requests\Adminarea\TenantFormRequest $request |
||
177 | * @param \Cortex\Tenants\Models\Tenant $tenant |
||
178 | * |
||
179 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
180 | */ |
||
181 | public function update(TenantFormRequest $request, Tenant $tenant) |
||
185 | |||
186 | /** |
||
187 | * Process stored/updated tenant. |
||
188 | * |
||
189 | * @param \Illuminate\Foundation\Http\FormRequest $request |
||
190 | * @param \Cortex\Tenants\Models\Tenant $tenant |
||
191 | * |
||
192 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
193 | */ |
||
194 | protected function process(FormRequest $request, Tenant $tenant) |
||
221 | |||
222 | /** |
||
223 | * Destroy given tenant. |
||
224 | * |
||
225 | * @param \Cortex\Tenants\Models\Tenant $tenant |
||
226 | * |
||
227 | * @throws \Exception |
||
228 | * |
||
229 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
230 | */ |
||
231 | public function destroy(Tenant $tenant) |
||
240 | } |
||
241 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.