PHP code example of lanin / laravel-extend-seeder

1. Go to this page and download the library: Download lanin/laravel-extend-seeder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lanin / laravel-extend-seeder example snippets


class Seeder extends \Lanin\ExtendSeeder\Seeder { }

class Account extends \Illuminate\Database\Eloquent\Model {
	protected $table = 'accounts';
}

class DatabaseSeeder extends Seeder {

	/**
	 * Seed your database.
	 */
	public function run()
	{
		$this->seedModel(\App\Account::class);
	}
}

class AccountsTableSeeder extends Seeder {

	/**
	 * Seed model.
	 */
	public function run()
	{
		$this->getModel()->truncate();
	}
}

class AccountsTableSeeder extends Seeder {

	/**
	 * Seed model with CSV.
	 */
	public function run()
	{
		$this->seedWithCsv();
	}
}

class DatabaseSeeder extends Seeder {

	/**
	 * Seed your database.
	 */
	public function run()
	{
		$this->seedModel(\App\Account::class)->seedWithCsv();
	}
}

class AccountsTableSeeder extends Seeder {

	/**
	 * Seed model.
	 */
	public function run()
	{

	}
}

class DatabaseSeeder extends Seeder {

	/**
	 * Seed your database.
	 */
	public function run()
	{
		$this->setModel(\App\Account::class)->seedWithCsv();
	}
}