Support the ongoing development of Laravel.io →
Laravel.io
Last updated 2 years ago.
0

@hirenkeraliya: Where/what is the error? you given code only?

No Worries!! create a file call 2014_10_12_000000_create_users_table.php with below code and test it.

<?php 
use Illuminate\Database\Schema\Blueprint; 
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration 
{ 

	/** 
		* Run the migrations. 
		* 
		* @return void 
		*/ 

	public function up() 
	{ 
		Schema::create('users', function (Blueprint $table) { 
			$table->increments('id'); 
			$table->string('name'); 
			$table->string('contact_number'); 
			$table->timestamps(); 
		}); 
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
	    Schema::drop('users');
	}
}

Read migration documentation for more.

Last updated 7 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.