You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
857 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Hash;
use App\User;
class TestUser extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$user = new User();
$user->name = 'admin';
$user->password = Hash::make('123456');
$user->email = 'andrey.pokidov@gmail.com';
$user->email_verified_at = time();
$user->remember_token = '';
$user->created_at = time();
$user->updated_at = time();
$user->save();
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$user = User::getByUsername('admin');
$user->delete();
}
}