You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
373B

  1. <?php
  2. namespace App\Sessions;
  3. use App\Features\InstanceAble;
  4. use Illuminate\Support\Facades\Auth;
  5. use Illuminate\Validation\UnauthorizedException;
  6. class SessionUser
  7. {
  8. use InstanceAble;
  9. public function user()
  10. {
  11. $user = Auth::user();
  12. if ($user === null) {
  13. throw new UnauthorizedException();
  14. }
  15. return $user;
  16. }
  17. }