| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 40 | public function handle() |
||
| 41 | { |
||
| 42 | // Fetch the first 3 users that have the most experience and NOT the role banished. |
||
| 43 | $users = User::whereDoesntHave('roles', function (Builder $query) { |
||
| 44 | $query->where('slug', 'banished'); |
||
| 45 | }) |
||
| 46 | ->orderBy('experiences_total', 'desc') |
||
| 47 | ->limit(3) |
||
| 48 | ->get(); |
||
| 49 | |||
| 50 | foreach ($users as $user) { |
||
| 51 | //Dispatch the event. |
||
| 52 | event(new LeaderboardEvent($user)); |
||
| 53 | } |
||
| 56 |