37 lines
1.0 KiB
PHP
37 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Scopes;
|
|
|
|
use App\Models\Tenant;
|
|
use App\Providers\AuthCheckProvider;
|
|
use App\Repositories\CostUnitRepository;
|
|
use App\Repositories\EventRepository;
|
|
use App\Repositories\InvoiceRepository;
|
|
use App\Repositories\PageTextRepository;
|
|
use App\Repositories\UserRepository;
|
|
|
|
abstract class CommonController {
|
|
protected Tenant $tenant;
|
|
protected UserRepository $users;
|
|
protected CostUnitRepository $costUnits;
|
|
|
|
protected PageTextRepository $pageTexts;
|
|
|
|
protected InvoiceRepository $invoices;
|
|
protected EventRepository $events;
|
|
|
|
public function __construct() {
|
|
$this->tenant = app('tenant');
|
|
$this->users = new UserRepository();
|
|
$this->costUnits = new CostUnitRepository();
|
|
$this->pageTexts = new PageTextRepository();
|
|
$this->invoices = new InvoiceRepository();
|
|
$this->events = new EventRepository();
|
|
}
|
|
|
|
protected function checkAuth() {
|
|
$authCheckProvider = new AuthCheckProvider;
|
|
return $authCheckProvider->checkLoggedIn();
|
|
}
|
|
}
|