|
- <?php
-
- namespace App\Http\Controllers\Web\Auth;
-
- use App\Models\User;
- use App\Codes\UserRole;
- use Illuminate\Support\Facades\Auth;
-
- trait Me
- {
- protected function me()
- {
- if (Auth::check()) {
- $user = Auth::user()->toArray();
-
- return array_intersect_key($user, array_flip([
- User::COL_NAME_ID,
- User::COL_NAME_CONTRACT_ID,
- User::COL_NAME_ROLE,
- ]));
- }
- return null;
- }
- }
|