Skip to content

Instantly share code, notes, and snippets.

@dertajora
Last active December 17, 2018 11:03
Show Gist options
  • Save dertajora/fc17bbeacc4aa9882dc29abb35413572 to your computer and use it in GitHub Desktop.
Save dertajora/fc17bbeacc4aa9882dc29abb35413572 to your computer and use it in GitHub Desktop.
Example of generated migration file when we want to create a table
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableUsers extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email');
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment