1. Go to this page and download the library: Download cheesegrits/iseed 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/ */
// File: /database/seeders/DatabaseSeeder.php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
if(App::environment() == "local")
{
throw new \Exception('Only run this from production');
}
// All generated seeds are added between #iseed_start & #iseed_end.
#iseed_start
$this->call(UsersTableSeeder::class);
#iseed_end
}
}