codeigniter 4 db seed
> php spark db:seed TestSeeder
codeigniter 4 db seed
> php spark db:seed TestSeeder
codeigniter 4 db seed
<?php namespace App\Database\Seeds;
class SimpleSeeder extends \CodeIgniter\Database\Seeder
{
public function run()
{
$data = [
'username' => 'darth',
'email' => '[email protected]'
];
// Simple Queries
$this->db->query("INSERT INTO users (username, email) VALUES(:username:, :email:)",
$data
);
// Using Query Builder
$this->db->table('users')->insert($data);
}
}
codeigniter 4 db seed
<?php namespace App\Database\Seeds;
class TestSeeder extends \CodeIgniter\Database\Seeder
{
public function run()
{
$this->call('UserSeeder');
$this->call('CountrySeeder');
$this->call('JobSeeder');
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us