first commit
This commit is contained in:
Executable
+51
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
|
||||
use Phinx\Seed\AbstractSeed;
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* classes Seeder
|
||||
*
|
||||
* @copyright 2019 Manaknightdigital Inc.
|
||||
* @link https://manaknightdigital.com
|
||||
* @license Proprietary Software licensing
|
||||
* @author Ryan Wong
|
||||
*/
|
||||
class classesSeeder extends AbstractSeed
|
||||
{
|
||||
/**
|
||||
* Run Method.
|
||||
*
|
||||
* Write your database seeder using this method.
|
||||
*
|
||||
* More information on writing seeders is available here:
|
||||
* http://docs.phinx.org/en/latest/seeding.html
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$data = [
|
||||
[
|
||||
'name' => 'CSE101',
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-j'),
|
||||
'updated_at' => date('Y-m-j H:i:s'),
|
||||
],
|
||||
[
|
||||
'name' => 'LAW101',
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-j'),
|
||||
'updated_at' => date('Y-m-j H:i:s'),
|
||||
],
|
||||
[
|
||||
'name' => 'PHY101',
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-j'),
|
||||
'updated_at' => date('Y-m-j H:i:s'),
|
||||
],
|
||||
|
||||
];
|
||||
$model = $this->table('classes');
|
||||
$model->truncate();
|
||||
$model->insert($data)->save();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user