2015-07-12 21:01:42 +02:00
|
|
|
<?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('email')->unique();
|
|
|
|
$table->string('password', 60);
|
|
|
|
$table->rememberToken();
|
2016-02-16 22:25:11 +01:00
|
|
|
$table->nullableTimestamps();
|
2015-07-12 21:01:42 +02:00
|
|
|
});
|
2015-08-29 16:03:42 +02:00
|
|
|
|
2016-05-01 22:20:50 +02:00
|
|
|
// Create the initial admin user
|
|
|
|
DB::table('users')->insert([
|
2015-08-29 16:03:42 +02:00
|
|
|
'name' => 'Admin',
|
|
|
|
'email' => 'admin@admin.com',
|
2016-05-01 22:20:50 +02:00
|
|
|
'password' => bcrypt('password'),
|
|
|
|
'created_at' => \Carbon\Carbon::now()->toDateTimeString(),
|
|
|
|
'updated_at' => \Carbon\Carbon::now()->toDateTimeString()
|
2015-08-29 16:03:42 +02:00
|
|
|
]);
|
2015-07-12 21:01:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::drop('users');
|
|
|
|
}
|
|
|
|
}
|