Giter VIP home page Giter VIP logo

laravel's Introduction

Laravel6

对Laravel6进行了小修改(也不算是修改,就算是把常用的东西整合上去)

1、返回接口统一

文件位置:
    App\Helpers\json.php;
使用:
    json_success($msg, $data);
    json_fail($msg, $data);

2、Monolog\Logger整合

文件位置:
    App\Helpers\logger.php;
使用:
    logInfo($title, [$msg]);
    logWarning($title, [$msg]);
    logError($title, [$msg]);
    logDebug($title, [$msg]);

3、JWT整合

文件位置:
    App\Models\User
使用:
    jwt整合到了auth,使用与auth一样

4、重写了异常处理

文件位置:
    App\Exceptions\Handler

5、整合了Repositories 设计模式

    生成对应文件:
        php artisan init:model-service
    文件位置:
        App\Repositories\*
        App\Facades\*
        App\Providers\RepositoryServiceProvider
    使用:
        use App\Facades\***;
        ***::getFirst()...
    这里封装的方法可以查看:
        App\Traits\RepositoryBaseRepositoryTrait
        App\Repositories\CommonRepository

6、在Helpers中封装了很多方法,也可以自己添加方法

    文件位置:
        App\Helpers\*

7、在 App\Traits\Controller*下封装了一些公共的Controller方法,需要使用就use

    文件位置:
        App\Traits\Controller\*
    使用:
        use App\Facades\Controller\***;

laravel's People

Contributors

iseekko 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.