1
0
Fork 0

admin init

develop
panliang 2023-04-25 11:39:37 +08:00
parent 27cb9a7d52
commit 91cf0dfcc8
7 changed files with 40 additions and 24 deletions

View File

@ -1,6 +1,6 @@
php artisan k:g
php artisan storage:link
php artsian admin:publish
php artisan admin:install
php artisan db:seed AdminMenuSeeder
- `cp .env.example .env`
- `php artisan key:generate`
- `php artisan storage:link`
- 创建数据库
- 修改 .env 文件中的配置
- `php artisan migrate --seed`

View File

@ -9,6 +9,7 @@ use Slowlyo\OwlAdmin\Renderers\TextControl;
use Slowlyo\OwlAdmin\Controllers\AdminController;
use App\Services\Admin\AdminNoticeService;
use App\Admin\Components;
use Slowlyo\OwlAdmin\OwlAdmin;
class AdminNoticeController extends AdminController
{
@ -18,12 +19,16 @@ class AdminNoticeController extends AdminController
public function list(): Page
{
$options = [];
$user = OwlAdmin::user();
// 添加权限
if ($user->can('admin_notice.create')) {
array_push($options, $this->createButton(true, 'lg'));
}
$options = array_merge($options, $this->baseHeaderToolBar(),);
$crud = $this->baseCRUD()
->filterTogglable(false)
->headerToolbar([
$this->createButton(true, 'lg'),
...$this->baseHeaderToolBar(),
])
->headerToolbar($options)
->columns([
TableColumn::make()->name('id')->label('ID')->sortable(true),
TableColumn::make()->name('title')->label('标题'),

View File

@ -21,13 +21,25 @@ class IndexController extends BaseController
'login_captcha' => config('admin.auth.login_captcha'),
'show_development_tools' => config('admin.show_development_tools'),
'system_theme_setting' => array_merge(
Admin::setting()->get('system_theme_setting', []),
[
'enableTab' => config('admin.layout.tab_enable'),
'tabIcon' => config('admin.layout.tab_icon'),
]
),
'system_theme_setting' => Admin::setting()->get('system_theme_setting', [
"animateInDuration" => 550,
"animateInType" => "alpha",
"animateOutDuration" => 450,
"animateOutType" => "alpha",
"breadcrumb" => true,
"breadcrumbIcon" => false,
"enableTab" => false,
"footer" => false,
"keepAlive" => false,
"layoutMode" => "default",
"loginTemplate" => "default",
"menuWidth" => 220,
"siderTheme" => "light",
"tabIcon" => true,
"theme" => "light",
"themeColor" => "#4080FF",
"topTheme" => "light",
]),
'enabled_extensions' => Extension::query()->where('is_enabled', 1)->pluck('name')?->toArray(),
]);
}

View File

@ -32,6 +32,8 @@ class SettingController extends AdminController
->redirect('')
->api($this->getStorePath())
->data(settings()->all())
->panelClassName('')
->title('')
->body(
Tabs::make()->tabs([
Tab::make()->title('基本设置')->body([

View File

@ -73,6 +73,7 @@ class AdminMenuSeeder extends Seeder
['title' => '权限管理', 'icon' => 'icon-park:key-one', 'url' => '/system/admin_permissions', 'order'=>3],
['title' => '菜单管理', 'icon' => 'icon-park:menu-fold-one', 'url' => '/system/admin_menus', 'order'=>4],
['title' => '字典管理', 'icon' => 'icon-park:arrow-keys', 'url' => '/keywords', 'order'=>5],
['title' => '配置管理', 'icon' => 'icon-park:setting-two', 'url' => '/system/settings', 'order'=>6],
],
],
];

View File

@ -14,11 +14,7 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
// \App\Models\User::factory(10)->create();
// \App\Models\User::factory()->create([
// 'name' => 'Test User',
// 'email' => 'test@example.com',
// ]);
$this->call(AdminMenuSeeder::class);
$this->call(AdminSeeder::class);
}
}

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="zh">
<html lang="zh-CN">
<head>
<meta charset="UTF-8"/>
<link rel="icon" href="/admin/logo.png"/>