<?php

use Dcat\Admin\Admin;
use Dcat\Admin\Grid;
use Dcat\Admin\Form;
use Dcat\Admin\Grid\Filter;
use Dcat\Admin\Show;
use Dcat\Admin\Layout\Content;
use Illuminate\Support\ServiceProvider;
/**
 * Dcat-admin - admin builder based on Laravel.
 * @author jqh <https://github.com/jqhph>
 *
 * Bootstraper for Admin.
 *
 * Here you can remove builtin form field:
 *
 * extend custom field:
 * Dcat\Admin\Form::extend('php', PHPEditor::class);
 * Dcat\Admin\Grid\Column::extend('php', PHPEditor::class);
 * Dcat\Admin\Grid\Filter::extend('php', PHPEditor::class);
 *
 * Or require js and css assets:
 * Admin::css('/packages/prettydocs/css/styles.css');
 * Admin::js('/packages/prettydocs/js/main.js');
 *
 */

// 设置后台布局
$newContent = new Content();
$newContent->view('distributor.layouts.content');
app()->singleton(Content::class, function () use ($newContent) {
    return $newContent;
});

// 获取当前登录用户
$user = Admin::guard()->check() ? Admin::user() : null;

// 设置应用程序的本地化
config(['app.locale' => $user && $user->language ? $user->language : config('app.locale')]);



//// 覆盖默认配置
//config(['admin' => user_admin_config()]);
//config(['app.locale' => config('admin.lang') ?: config('app.locale')]);
