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%
6 / 6
Prod
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
6 / 6
 __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%
4 / 4
1<?php
2
3
4namespace Qmp\Laravel\CommandsLaravel\Console\Commands;
5
6use Illuminate\Console\Command;
7use Illuminate\Support\Facades\DB;
8
9class Prod extends Command
10{
11    /**
12     * The name and signature of the console command.
13     *
14     * @var string
15     */
16    protected $signature = 'command:prod {prod}';
17
18    /**
19     * The console command description.
20     *
21     * @var string
22     */
23    protected $description = 'Set Prod 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        $prod = $this->argument('prod');
43
44        DB::table('crons')->update(['prod' => $prod, 'updated_at' => now()]);
45        $this->info( 'Set All commands to prod' . $prod);
46    }
47}