Coder Social home page Coder Social logo

packagit / dcat-admin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jqhph/dcat-admin

0.0 0.0 1.0 76.5 MB

๐Ÿ”ฅ ๅŸบไบŽ Laravel ็š„ๅŽๅฐ็ณป็ปŸๆž„ๅปบๅทฅๅ…ท (Laravel Admin)๏ผŒไฝฟ็”จๅพˆๅฐ‘็š„ไปฃ็ ๅฟซ้€Ÿๆž„ๅปบไธ€ไธชๅŠŸ่ƒฝๅฎŒๅ–„็š„้ซ˜้ขœๅ€ผๅŽๅฐ็ณป็ปŸ๏ผŒๅ†…็ฝฎไธฐๅฏŒ็š„ๅŽๅฐๅธธ็”จ็ป„ไปถ๏ผŒๅผ€็ฎฑๅณ็”จ๏ผŒ่ฎฉๅผ€ๅ‘่€…ๅ‘Šๅˆซๅ†—ๆ‚็š„HTMLไปฃ็ 

Home Page: http://www.dcatadmin.com

License: MIT License

Shell 0.01% PHP 86.37% CSS 2.86% Blade 3.97% SCSS 6.79%

dcat-admin's Introduction

Packagit

Packagit is amazing laravel modules management, you could manage huge project with many separate laravel modules.

You could run packagit or a short name p, such as p new Auth, a module named Auth would be created.

You can make artisan command running anywhere, All the packagit commands are same with artisan like following table.

artisan packagit
php artisan tinker p tinker
php artisan make:controller p make:controller
php artisan make:migration p make:migration
php artisan make:job p make:job
php artisan test p test
php artisan ... p ...

for example, you have a project named starter, directories layout:

starter
    โ””โ”€โ”€ modules
        โ”œโ”€โ”€ Auth
        โ”œโ”€โ”€ Components
        โ””โ”€โ”€ Wechat

change path to starter/modules/Auth, and run p make:controller:

cd starter/modules/Auth
p make:controller DemoController

DemoController.php would be created for Auth module.

modules/Auth/src/Http/
โ””โ”€โ”€ Controllers
   โ””โ”€โ”€ DemoController.php

change path to starter/app/Http/Controllers, and p make:controller:

cd starter/app/Http/Controllers
p make:controller DemoController

DemoController.php would be created for starter, because of current path doesn't include any module.

So when you run p make:xxx laravel command, packagit would scan the path, if current is in a module path, it will create for the module, otherwise for the project.

Installation

composer global require packagit/packagit

You MUST install packagit with global, and add composer bin to the $PATH environment.

Following command would help you find the global bin path:

composer global config bin-dir --absolute --global

# such as $HOME/.composer/vendor/bin, add to $PATH
# save to ~/.zshrc or ~/.bashrc
export PATH=$HOME/.composer/vendor/bin:$PATH

Usage

1. Custom package namespace (Optional)

run p custom

config/packagit.php file would be created, you could customize namespace by edit this file, skip here if you don't need custom.

2. Create a new module

run packagit new ModuleName

you also could group many modules as Components or others you want.

packagit new Components/NetUtil
packagit new Components/Updater
packagit new Components/Downloader

A Module Structure:

โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ composer.json
โ”œโ”€โ”€ config
โ”‚ย ย  โ””โ”€โ”€ config.php
โ”œโ”€โ”€ database
โ”‚ย ย  โ”œโ”€โ”€ factories
โ”‚ย ย  โ”œโ”€โ”€ migrations
โ”‚ย ย  โ””โ”€โ”€ seeders
โ”‚ย ย      โ””โ”€โ”€ DatabaseSeeder.php
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ resources
โ”œโ”€โ”€ routes
โ”‚ย ย  โ”œโ”€โ”€ api.php
โ”‚ย ย  โ””โ”€โ”€ web.php
โ”œโ”€โ”€ src
โ”‚ย ย  โ”œโ”€โ”€ Models
โ”‚ย ย  โ””โ”€โ”€ Providers
โ”‚ย ย      โ”œโ”€โ”€ CommandServiceProvider.php
โ”‚ย ย      โ”œโ”€โ”€ RouteServiceProvider.php
โ”‚ย ย      โ””โ”€โ”€ ServiceProvider.php
โ”œโ”€โ”€ tests
โ”‚ย ย  โ”œโ”€โ”€ Feature
โ”‚ย ย  โ””โ”€โ”€ Unit
โ””โ”€โ”€ webpack.mix.js

Load modules in project

1ใ€composer require wikimedia/composer-merge-plugin

edit project/composer.json => extra => merge-plugins:

    "extra": {
        "merge-plugin": {
            "include": [
                "modules/*/composer.json",
                "modules/Components/*/composer.json"
            ],
            "recurse": false,
            "replace": true,
            "ignore-duplicates": false,
            "merge-dev": true,
            "merge-extra": true,
            "merge-extra-deep": true
        },
        "laravel": {
            "dont-discover": []
        }
    },

2ใ€composer dump-autoload

3ใ€edit project/config/app.php

    'providers' => [
        \Packagit\[MoudleName]\Providers\ServiceProvider::class, 
    ],

All done, modules should work well.

License

The Apache License 2. Please see License File for more information.

dcat-admin's People

Contributors

abbotton avatar attentive20 avatar celaraze avatar edwinhuish avatar flc1125 avatar gelaku avatar gzxy-0102 avatar ihipop avatar iljalukin avatar jorry2008 avatar jqhph avatar laradocs avatar larvacent avatar lilashih avatar martialbe avatar nivin-studio avatar pianzhou2021 avatar porygoncn avatar puzzle9 avatar shacky avatar smallruraldog avatar sparkinzy avatar stylecibot avatar vagra avatar xiaohuilam avatar xqbumu avatar ybid avatar youyingxiang avatar yurenzhen avatar zhaiyuxin103 avatar

Forkers

gitwangliang

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.