Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

27 lines
524B

  1. <?php
  2. namespace App\Http\Controllers\Web\Auth;
  3. use App\Exceptions\AppCommonException;
  4. use App\Kintone\Models\Customer;
  5. use Illuminate\Support\Facades\Auth;
  6. trait Me
  7. {
  8. public function me(): array
  9. {
  10. if (!Auth::check()) {
  11. throw new AppCommonException("Me失敗");
  12. }
  13. $user = Auth::user();
  14. $access = Customer::getAccess();
  15. /**
  16. * @var Customer
  17. */
  18. $customer = $access->find($user->kintone_id);
  19. return $customer->toArray();
  20. }
  21. }