Mojito

Mojito Admin — 基于 Laravel, Vue3, Element Plus构建的后台管理系统
Alternatives To Mojito
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Filament12,764
14 hours ago105mitPHP
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
Laravel Admin10,9786394493 months ago108May 24, 2022239mitPHP
Build a full-featured administrative interface in ten minutes
Aimeos Laravel6,7802514 days ago139November 17, 20233mitPHP
Laravel ecommerce package for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce
Platform4,11419202 days ago474October 22, 2023118mitPHP
Orchid is a @laravel package that allows for rapid application development of back-office applications, admin/user panels, and dashboards.
Dcat Admin3,68855a month ago73February 15, 2023194mitPHP
🔥 基于 Laravel 的后台系统构建工具 (Laravel Admin),使用很少的代码快速构建一个功能完善的高颜值后台系统,内置丰富的后台常用组件,开箱即用,让开发者告别冗杂的HTML代码
Aimeos3,632
10 days ago43November 02, 20233mitJavaScript
Integrated online shop based on Laravel 10 and the Aimeos e-commerce framework for ultra-fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce
Twill3,515
15 hours ago115May 23, 202363apache-2.0PHP
Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/cnWk7EFv8R.
Crud2,8862211143 days ago536December 07, 2023111mitPHP
Build custom admin panels. Fast!
Laravel Shop2,389
a year ago25PHP
Laravel 电商实战教程的项目代码
Vue Material Admin2,256
5 days ago21mitVue
A vue material design admin template
Alternatives To Mojito
Select To Compare


Alternative Project Comparisons
Readme

Mojito

Mojito 是基于 Laravel 开发的 Mojito Admin 的服务端。

3.0 版本开始, 已将原来的项目分离为两个代码库,分别为以Vue3、Element Plus、Vite 开发的前端模板 mojito -admin 和服务端 mojito 。如果是需要使用 vue2 版本,请访问 2.0 分支。

Mojito Admin 截图

mojito.png

特性

  • 前后端分离,提供 Mojito Admin 前端模板
  • 基于 laravel-permission 权限管理
  • 基于 sanctum 鉴权
  • 提供角色,权限,用户,菜单管理等功能的API
  • 多个后台支持统一管理权限,菜单和角色
  • 完善的PHPUnit测试

要求

  • Laravel >= 7.0.0
  • PHP >= 7.2.0

安装

首先安装laravel,并且确保你配置了正确的数据库连接。

composer require moell/mojito

然后运行下面的命令来发布资源:

php artisan mojito:install

命令执行成功会生成配置文件,数据迁移和构建SPA的文件。

修改 app/Http/Kernel.php

class Kernel extends HttpKernel
{
    protected $routeMiddleware = [
        ...
        'mojito.permission' => \Moell\Mojito\Http\Middleware\Authenticate::class,
    ];

    protected $middlewareGroups = [
            ...
            'api' => [
                ...
                \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
            ],
        ];
}

执行数据迁移,数据填充

php artisan migrate

php artisan db:seed --class="Moell\Mojito\Database\MojitoTableSeeder"

后台登录的账号 admin , 密码 secret

路由中间件

  • auth:sanctum 用于鉴权
  • mojito.permission 权限验证

mojito.php 可选配置

return [
    'guards' => [
        // laravel-permission 相对应的 guard
        'admin' => [
            'model' => \Moell\Mojito\Models\AdminUser::class, //登录鉴权的模型
            'login_fields' => [	// 登录验证的字段,支持多个
                'username',
            ],
            'conditions' => [ // 登录验证的额外条件
                ['status', '=', 1]
            ]
        ]
    ],
    'route_prefix' => "api", //路由前缀
    
    'middleware' => [
        'basic' => 'api', //基础中间件

        'auth' => ['auth:sanctum'], //鉴权中间件

        'permission' => ['auth:sanctum', 'mojito.permission'] //包含权限检测的中间件
    ]
];

依赖扩展包

  • spatie/laravel-permission
  • laravel/sanctum

常见错误

  • csrf token missing or incorrect , 请修改 sanctum.php 中的 stateful , 如 vite 使用的 localhost:3000去除即可。更多详细请访问laravel/sanctum文档。

打赏

License

Apache License Version 2.0 see http://www.apache.org/licenses/LICENSE-2.0.html

Popular Laravel Projects
Popular Admin Projects
Popular Frameworks Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Php
Vue
Laravel
Admin
Single Page Applications
Phpunit
Vue Admin
Laravel Admin