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.

67 lines
1.4 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class PushAuthData extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$data = [[
'name' => 'admin_basics',
'title' => '后台基础接口',
'icon' => '',
'pid' => '0',
'type' => '1',
'check_type' => '1',
'show' => '2',
], [
'name' => 'admin_basics_login',
'title' => '后台登录',
'icon' => '',
'pid' => '1',
'type' => '2',
'check_type' => '1',
'show' => '2',
], [
'name' => 'admin_basics_status',
'title' => '后台登录状态',
'icon' => '',
'pid' => '1',
'type' => '2',
'check_type' => '1',
'show' => '2',
]];
foreach ($data as $datum) {
$auth = new App\Models\Auth();
$auth->name = $datum['name'];
$auth->title = $datum['title'];
$auth->icon = $datum['icon'];
$auth->pid = $datum['pid'];
$auth->type = $datum['type'];
$auth->check_type = $datum['check_type'];
$auth->show = $datum['show'];
$auth->status = 1;
$auth->del = 2;
$auth->order = 0;
$auth->save();
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}