- <?php
-
- namespace App\Http\Controllers\Web\Auth;
-
- use App\Exceptions\AppCommonException;
- use Illuminate\Support\Facades\Auth;
-
- trait Me
- {
- public function me(): array
- {
- if (!Auth::check()) {
- throw new AppCommonException("Me失敗");
- }
- return Auth::user()->toArray();
- }
- }
|