Базовая версия сервера API с авторизацией по протоколу OAuth2
This commit is contained in:
41
database/migrations/2020_02_25_050427_test_user.php
Normal file
41
database/migrations/2020_02_25_050427_test_user.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user