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