1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace Database\Seeders\Backend;
- use Database\Seeders\BaseSeeder;
- use Illuminate\Support\Str;
- use Txj\Elastic\Facades\Eav;
- /**
- * 动态路由,控制前端路由
- */
- class AdminRouterGroupSeeder extends BaseSeeder
- {
- public function getColumnData()
- {
- return [
- 'title' => ['type' => 'string_60', 'title' => '分组标题'],
- 'name' => ['type' => 'string_60', 'title' => '分组标识'],
- 'icon' => ['type' => 'string_60', 'title' => '图标'],
- 'status' => ['type' => 'tinyint', 'title' => '状态', 'remark' => '1 启用 其他不启用'],
- ];
- }
- public function init()
- {
- Eav::table($this->schema)->insert(
- [
- [
- 'mid' => Str::random(12),
- 'title' => '默认',
- 'name' => 'home',
- 'status' => 1,
- 'created_at' => time(),
- 'updated_at' => time()
- ],
- ]
- );
- }
- /**
- * Run the database seeds.
- *
- * @return void
- */
- public function run()
- {
- $this->schema = 'web_router_group';
- $this->title = '路由分组表';
- // $this->category_type = 2;
- $this->start();
- }
- }
|