1 | <?php |
||
2 | |||
3 | namespace App\Console\Commands; |
||
4 | |||
5 | use Illuminate\Console\Command; |
||
6 | use App\Http\Controllers\ExaminationStudentsController; |
||
7 | use App\Models\Examination_student; |
||
8 | |||
9 | class ExaminationsUpdateCensusNo extends Command |
||
10 | { |
||
11 | /** |
||
12 | * The name and signature of the console command. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $signature = 'examination:updateCensus'; |
||
17 | |||
18 | /** |
||
19 | * The console command description. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $description = 'Command description'; |
||
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 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); |
||
43 | $output->writeln('###########################################------Inserting file records------###########################################'); |
||
44 | $this->examinationController = new ExaminationStudentsController(2019, 'G4'); |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
45 | $students = Examination_student::all()->toArray(); |
||
46 | $func = $this->examinationController; |
||
47 | array_walk($students,array($func,'updateCensusNo')); |
||
48 | |||
49 | |||
50 | } |
||
51 | } |
||
52 |