| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 18 | 
| Code Lines | 9 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 10 | 
| CRAP Score | 1 | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 21 | 5 | public function handle(ServerWasPoked $event) | |
| 22 |     { | ||
| 23 | 5 | $device = $event->getDevice()->toArray(); | |
| 24 | |||
| 25 | // device count | ||
| 26 | 5 | DeviceArchive::updateOrCreate( | |
| 27 | 5 | ['mac_hash' => md5($device['mac'])], | |
| 28 | 5 | ['updated_at' => Carbon::now()] | |
| 29 | ); | ||
| 30 | |||
| 31 | // network distribution | ||
| 32 | 5 | $network = ExtractNetwork::fromIp($device['ip']); | |
| 33 | 5 |         DB::table('network_distribution')->where('network', $network)->increment('pokes'); | |
| 34 | |||
| 35 | // pokes | ||
| 36 | 5 | $date = Carbon::now()->toDateString(); | |
| 37 | 5 |         Poke::firstOrCreate(['date' => $date])->increment('pokes'); | |
| 38 | 5 | } | |
| 39 | } | ||
| 40 |