ivanaquino / jet-admin

Jetstream livewire 管理员

资助包维护!
Ivan Aquino

安装次数: 83

依赖项: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 0

开放问题: 1

语言:Blade

0.1.3 2024-08-18 19:19 UTC

This package is auto-updated.

Last update: 2024-09-18 19:30:26 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

此包为使用 Laravel Jetstream 和 Livewire 的应用程序提供优雅且响应式的管理面板和着陆页布局。它提供了一种快速简单的方法来构建应用程序的管理界面和着陆页,节省您在开发初期的时间和精力。

安装

注意:Flowbite 包不再需要。

你是视觉学习者吗?查看我们的 YouTube 视频 https://youtu.be/yPIGqrF1GAM

您可以通过 composer 安装此包

composer require ivanaquino/jet-admin

将暗色模式添加到您的 tailwind config 文件 tailwind.config.js

{
    darkMode: 'class',
    ...
}

更改主色调很简单,您只需修改 tailwind 配置文件 tailwind.config.js

{
    theme: {
        extend: {
            // ...
            colors: {
                'primary': {
                    '50': '#eaf5ff',
                    '100': '#d9ecff',
                    '200': '#badbff',
                    '300': '#91c1ff',
                    '400': '#659bff',
                    '500': '#4273ff',
                    '600': '#2149ff',
                    '700': '#183bec',
                    '800': '#1533be',
                    '900': '#1b3494',
                    '950': '#101d56',
                },
            },
        },
    },
}

发布 jet-admin JavaScript

php artisan vendor:publish --tag="jet-admin-js"

现在将 jet-admin JS 添加到 ./resources/js/app.js

import './vendor/jet_admin';

要更改导航项,您必须发布配置文件

php artisan vendor:publish --tag="jet-admin-config"

这是已发布配置文件的内容

return [
    /*
     |--------------------------------------------------------------------------
     | Landing Navigation
     |--------------------------------------------------------------------------
     |
     | name: Could be a string or a translation key this will be passed through the __() function
     | route: Could be a url or a route name
     |
     |*/
    'landing_navigation' => [
        [
            'name' => 'Home',
            'route' => '/',
        ],
    ],

    /*
     |--------------------------------------------------------------------------
     | Dashboard Navigation
     |--------------------------------------------------------------------------
     |
     | Items in this array will be used to generate the dashboard sidebar
     | - name: The label that will be displayed in the sidebar
     | - route: Could be a route name or a URL
     | - active_route: The route name or URL that will be used to determine if the item is active
     | - icon: The icon that will be displayed in the sidebar, Heroicons' name.
     |
     |*/
    'dashboard_navigation' => [
        [
            'name' => 'Dashboard',
            'route' => 'dashboard',
            'active_route' => 'dashboard*',
            'icon' => 'home',
        ],
        [
            'name' => 'Profile',
            'route' => 'profile.show',
            'active_route' => 'profile.show',
            'icon' => 'user',
        ],
        // [
        //     'name' => 'Url example',
        //     'route' => 'my-url',
        //     'active_route' => 'my-url',
        //     'icon' => 'shield-exclamation',
        // ],
    ],
];

可选地,您可以使用以下方式发布视图

php artisan vendor:publish --tag="jet-admin-views"

用法

着陆布局

<x-jet-admin::landing-layout>
    Your own content goes here...
</x-jet-admin::landing-layout>

仪表盘布局

<x-jet-admin::dashboard-layout>
    Your dashboard content goes here...
</x-jet-admin::dashboard-layout>

{{-- OR --}}

<x-jet-admin::second-dashboard-layout>
    Your dashboard content goes here...
</x-jet-admin::second-dashboard-layout>

测试

composer test

更新日志

请参阅 更新日志 了解最近更改的详细信息。

贡献

请参阅 贡献指南 了解详细信息。

安全漏洞

请查阅 我们的安全策略 了解如何报告安全漏洞。

致谢

许可

MIT 许可证 (MIT)。请参阅 许可文件 了解更多信息。