| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 14 | 
| Code Lines | 7 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 25 | public function handle()  | 
            ||
| 26 |     { | 
            ||
| 27 |         $this->comment('Cleaning schedule log...'); | 
            ||
| 28 | |||
| 29 | $maxAgeInDays = 30;  | 
            ||
| 30 | |||
| 31 |         $cutOffDate = Carbon::now()->subDays($maxAgeInDays)->format('Y-m-d H:i:s'); | 
            ||
| 32 | |||
| 33 |         $amountDeleted = Schedulelog::where('created_at', '<', $cutOffDate)->delete(); | 
            ||
| 34 | |||
| 35 |         $this->info("Deleted {$amountDeleted} record(s) from the schedule log."); | 
            ||
| 36 | |||
| 37 |         $this->comment('All done!'); | 
            ||
| 38 | }  | 
            ||
| 39 | }  | 
            ||
| 40 |