GithubHelp home page GithubHelp logo

iamxcd / mojito Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moell-peng/mojito

0.0 0.0 0.0 126 KB

Mojito admin is a component of laravel, vue, element build backend system

Home Page: https://moell-peng.github.io/mojito-doc

License: Apache License 2.0

PHP 49.90% Vue 35.30% JavaScript 13.30% CSS 1.39% HTML 0.11%

mojito's Introduction

Mojito

Mojito is a backend management system based on Laravel, Vue, Element.

Simplified Chinese

中文README

Screenshot

Feature

  • Quickly derive multiple backend systems
  • Built-in role, permissions, user, menu management
  • OAuth 2.0 and support multi-table authentication
  • Complete PHPUnit test
  • The minimum unit of API privilege is routing, and the minimum unit of page privilege is button or link.
  • SPA
  • Multi-tab page
  • Support for multi-language configuration
  • Simple page layout

Requirements

  • Laravel >= 5.5.0
  • Vue >= 2.5.17
  • Element >= 2.4.6

Compatibility

Laravel Mojito admin
5.5, 5.6 1.0.*
5.7,5.8 1.1.*
6.x 1.2.*

Installation

First install laravel and make sure you have the correct database connection configured.

composer require moell/mojito

If there is a conflict caused by the random_compat version, manually add moell/mojito to composer.json and then composer update to install.

Then run the following command to publish the resource:

php artisan mojito:install

Successful execution of the command will generate configuration files, data migration, and building SPA files.

Add the appropriate guards and providers to config/auth.php as follows:

'guards' => [
        ...
        'admin' => [
            'driver' => 'passport',
            'provider' => 'admin'
        ]
    ],

'providers' => [
        ...
        'admin' => [
            'driver' => 'eloquent',
            'model' => \Moell\Mojito\Models\AdminUser::class,
        ]
    ],

Add oauth.providers and mojito.permission in the middle of the $routeMiddleware property in app/Http/Kernel.php and replace the auth middleware with the following:

class Kernel extends HttpKernel
{
    protected $routeMiddleware = [
        // 'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
        'auth' => \SMartins\PassportMultiauth\Http\Middleware\MultiAuthenticate::class,
        'oauth.providers' => \SMartins\PassportMultiauth\Http\Middleware\AddCustomProvider::class,
        'mojito.permission' => \Moell\Mojito\Http\Middleware\Authenticate::class,
    ];
}

Perform data migration, data filling

php artisan migrate

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

Passport installation and configuration

php artisan passport:install

After successful execution, obtain the corresponding password to grant the client's ID and secret and configure it to the corresponding resources/config/index.js :

export default {
  admin: {
    authorize: {
      clientId: ID,
      clientSecret: secret
    }
}

Install JavaScript Dependencies

npm install
npm install -D vue@^2.6.6 vuex@^3.0.1 vue-router@^3.0.1 vue-i18n@^8.1.0 localforage@^1.7.2 element-ui@^2.9.1

Add admin.js to webpack.mix.js

mix.js('resources/js/admin.js', 'public/js');

Run Mix

#npm run watch
npm run production

Log in

url: http://localhost/mojito#/admin/login

email: [email protected]

password: secret

Dependent on open source software

  • Laravel
  • Vue
  • Element UI
  • laravel/passport
  • smartins/passport-multiauth
  • spatie/laravel-permission
  • orchestra/testbench

Reward

License

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

mojito's People

Contributors

eddiclin avatar iamxcd avatar moell-peng avatar samnela avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.