This commit is contained in:
Torsten 2024-11-13 09:05:39 +01:00
parent a6fdbefc80
commit b9cc6c0f1a
19 changed files with 64 additions and 0 deletions

View file

@ -0,0 +1,30 @@
```bash
php spark make:scaffold Product
```
Creates Controller, Model, Migration, Seeder
```php
//up:
$this->forge->addField((["id"=>
["type"=>"INT,
"constraint"=>5,
"auto increment" => true,
"unsigned" => true
],
"name" => ["type"=>"VARCHAR".
"constraint" => 120,
"null" => false
]
]
));
$this->forge->addPrimaryKey("id);
$this->forge->createTable("students");
//down:
$this->forge->dropTable("students");
```
```bash
php spark migrate
```