| Conditions | 2 |
| Paths | 1 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function createToken() |
||
| 18 | { |
||
| 19 | // generate a random string using Laravel's str_random helper |
||
| 20 | // check if the token already exists and if it does, try again |
||
| 21 | do { |
||
| 22 | $token = Str::random(24); |
||
| 23 | } while ($this->user->where('token', $token)->first()); |
||
| 24 | |||
| 25 | return $token; |
||
| 26 | } |
||
| 28 |