Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
5 / 5
Enable
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
5 / 5
 __construct
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 handle
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
1<?php
2
3
4namespace Qmp\Laravel\CommandsLaravel\Console\Commands;
5
6use Illuminate\Console\Command;
7use Illuminate\Support\Facades\DB;
8
9class Enable extends Command
10{
11    /**
12     * The name and signature of the console command.
13     *
14     * @var string
15     */
16    protected $signature = 'command:enable';
17
18    /**
19     * The console command description.
20     *
21     * @var string
22     */
23    protected $description = 'Enable all commands in crons table';
24
25    /**
26     * Create a new command instance.
27     *
28     * @return void
29     */
30    public function __construct()
31    {
32        parent::__construct();
33    }
34
35    /**
36     * Execute the console command.
37     *
38     * @return mixed
39     */
40    public function handle()
41    {
42        DB::table('crons')->update(['pause' => 0, 'updated_at' => now()]);
43
44        $this->info('All commands are enable');
45    }
46}