Basic design created
This commit is contained in:
1 parent
3570f442f5
commit
e280fcfba8
29 files changed
+1055
-28
No files matched your search
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
class AuthCheckProvider {
|
||||
public function checkLoggedIn() : bool {
|
||||
if (!auth()->check()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$user = auth()->user();
|
||||
$tenant = app('tenant');
|
||||
return $user->active && $tenant->slug === $user->tenant;
|
||||
}
|
||||
|
||||
public function getUserRole() : ?string {
|
||||
if (!$this->checkLoggedIn()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return auth()->user()->user_role;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user