database/seeds/CustomerPurchasesTableSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $customer_purchases = array(
            array(
                "id" => 1,
                "customer_id" => 1,
                "membership_id" => 1,
                "joining_at" => "2021-05-29",
                "expire_at" => "2021-12-20",
                "status" => "active",
                "membership_type"=>'monthly',
                "membership_price"=>'500'
            ),
            array(
                "id" => 2,
                "customer_id" => 2,
                "membership_id" => 1,
                "joining_at" => "2021-06-01",
                "expire_at" => "2021-07-20",
                "status" => "active",
                "membership_type"=>'monthly',
                "membership_price"=>'500'
            ),
            array(
                "id" => 3,
                "customer_id" => 2,
                "membership_id" => 1,
                "joining_at" => "2021-06-03",
                "expire_at" => "2021-07-20",
                "status" => "active",
                "membership_type"=>'monthly',
                "membership_price"=>'500'
            ),
            array(
                "id" => 4,
                "customer_id" => 1,
                "membership_id" => 1,
                "joining_at" => "2021-06-09",
                "expire_at" => "2021-07-20",
                "status" => "complete",
                "membership_type"=>'monthly',
                "membership_price"=>'500'
            ),
            array(
                "id" => 5,
                "customer_id" => 1,
                "membership_id" => 1,
                "joining_at" => "2021-06-09",
                "expire_at" => "2021-07-20",
                "status" => "complete",
                "membership_type"=>'monthly',
                "membership_price"=>'500'
            ),
            array(
                "id" => 7,
                "customer_id" => 1,
                "membership_id" => 1,
                "joining_at" => "2021-06-09",
                "expire_at" => "2021-07-20",
                "status" => "complete",
                "membership_type"=>'lifetime',
                "membership_price"=>'2000'
            ),
            array(
                "id" => 6,
                "customer_id" => 2,
                "membership_id" => 1,
                "joining_at" => "2021-06-09",
                "expire_at" => "2021-07-20",
                "status" => "complete",
                "membership_type"=>'monthly',
                "membership_price"=>'500'
            ),
        );
        foreach ($customer_purchases as $customer_purchase)
        {
            \App\Models\CustomerPurchases::create($customer_purchase);
        }
    }
public function run ( ) { $ customer_purchases = array ( array ( " id " => 1 , " customer_id " => 1 , " membership_id " => 1 , " joining_at " => " 2021-05-29 " , " expire_at " => " 2021-12-20 " , " status " => " active " , " membership_type " => 'monthly' , " membership_price " => '500' ) , array ( " id " => 2 , " customer_id " => 2 , " membership_id " => 1 , " joining_at " => " 2021-06-01 " , " expire_at " => " 2021-07-20 " , " status " => " active " , " membership_type " => 'monthly' , " membership_price " => '500' ) , array ( " id " => 3 , " customer_id " => 2 , " membership_id " => 1 , " joining_at " => " 2021-06-03 " , " expire_at " => " 2021-07-20 " , " status " => " active " , " membership_type " => 'monthly' , " membership_price " => '500' ) , array ( " id " => 4 , " customer_id " => 1 , " membership_id " => 1 , " joining_at " => " 2021-06-09 " , " expire_at " => " 2021-07-20 " , " status " => " complete " , " membership_type " => 'monthly' , " membership_price " => '500' ) , array ( " id " => 5 , " customer_id " => 1 , " membership_id " => 1 , " joining_at " => " 2021-06-09 " , " expire_at " => " 2021-07-20 " , " status " => " complete " , " membership_type " => 'monthly' , " membership_price " => '500' ) , array ( " id " => 7 , " customer_id " => 1 , " membership_id " => 1 , " joining_at " => " 2021-06-09 " , " expire_at " => " 2021-07-20 " , " status " => " complete " , " membership_type " => 'lifetime' , " membership_price " => '2000' ) , array ( " id " => 6 , " customer_id " => 2 , " membership_id " => 1 , " joining_at " => " 2021-06-09 " , " expire_at " => " 2021-07-20 " , " status " => " complete " , " membership_type " => 'monthly' , " membership_price " => '500' ) , ) ; foreach ( $ customer_purchases as $ customer_purchase ) { \ App \ Models \ CustomerPurchases :: create ( $ customer_purchase ) ; } }
Run the database seeds.
Run the database seeds .