laravel add record to table on migrate code example

Example 1: insert rows in migrations laravel

public function up()
{
    // Create the table
    Schema::create('users', function($table){
        $table->increments('id');
        $table->string('email', 255);
        $table->string('password', 64);
        $table->boolean('verified');
        $table->string('token', 255);
        $table->timestamps();
    });

    // Insert some stuff
    DB::table('users')->insert(
        array(
            'email' => '[email protected]',
            'verified' => true
        )
    );
}

Example 2: laravel migrate in browser

\Artisan::call('migrate',
 array(
   '--path' => 'database/migrations',
   '--database' => 'dynamicdb',
   '--force' => true));

Tags:

Php Example