| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function authorize(): bool |
||
| 19 | { |
||
| 20 | parent::authorize(); |
||
| 21 | |||
| 22 | $user = $this->user($this->route('guard')) |
||
| 23 | ?? $this->attemptUser($this->route('guard')) |
||
|
|
|||
| 24 | ?? app('cortex.auth.admin')->whereNotNull('phone')->where('phone', $this->get('phone'))->first(); |
||
| 25 | |||
| 26 | if (! $user) { |
||
| 27 | // User instance required to detect active TwoFactor methods |
||
| 28 | throw new GenericException(trans('cortex/foundation::messages.session_required'), route('adminarea.login')); |
||
| 29 | } |
||
| 30 | |||
| 31 | return true; |
||
| 32 | } |
||
| 33 | |||
| 44 |
If you implement
__calland you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__callis implemented by a parent class and only the child class knows which methods exist: