The-3Labs-Team/nova-busy-resource-field

View on GitHub
src/App/Console/Commands/BusyCommand.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace The3labsTeam\NovaBusyResourceField\App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;

class BusyCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'nova-busy-resource-field:run';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Execute the console command.
     */
    public function handle()
    {
        DB::table('busiables')->where('updated_at', '<', now()->subSeconds(config('nova-busy-resource-field.threshold-old'))->format('Y-m-d H:i:s'))->delete();
    }
}