欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

laravel常用插件 博客分类: PHP laravel插件 

程序员文章站 2024-03-14 13:12:16
...
以下插件本人实际验证过:



如果lavavel的版本5.8

composer.phar create-project --prefer-dist laravel/laravel goquery 5.8.*

# 语言包
composer.phar require "overtrue/laravel-lang:~3.0"
修改config/app.php
Overtrue\LaravelLang\TranslationServiceProvider::class,替换掉同名类

php artisan lang:publish zh-CN

//安装lavaral-admin的最新版本 1.6.15,"encore/laravel-admin": "^1.6",
composer.phar require encore/laravel-admin
# php artisan vendor:publish --provider="Encore\Admin\AdminServiceProvider"

Copied Directory [/vendor/encore/laravel-admin/config] To [/config]
Copied Directory [/vendor/encore/laravel-admin/resources/lang] To [/resources/lang]
Copied Directory [/vendor/encore/laravel-admin/database/migrations] To [/database/migrations]
Copied Directory [/vendor/encore/laravel-admin/resources/assets] To [/public/vendor/laravel-admin]

# php artisan admin:install
Migrating: 2016_01_04_173148_create_admin_tables
Migrated:  2016_01_04_173148_create_admin_tables
Database seeding completed successfully.
Admin directory was created: /app/Admin
HomeController file was created: /app/Admin/Controllers/HomeController.php
AuthController file was created: /app/Admin/Controllers/AuthController.php
ExampleController file was created: /app/Admin/Controllers/ExampleController.php
Bootstrap file was created: /app/Admin/bootstrap.php
Routes file was created: /app/Admin/routes.php


# composer.phar require yansongda/pay

# composer.phar require moontoast/math
"moontoast/math": "^1.1", 这是数学函数

后台验证码接口
文档:
# composer.phar require james.xue/login-captcha:1.8.1

jwt插件
# composer.phar require tymon/jwt-auth:1.0.0-rc.4

下面这句话,很可能是拷贝一个jwt配置文件,无他,没有其他作用
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"

php artisan jwt:secret # xieye ,# 根据经验,这句话只修改.env文件!

跨域插件
# composer.phar require barryvdh/laravel-cors
php artisan vendor:publish --provider="Barryvdh\Cors\ServiceProvider"
Copied File [/vendor/barryvdh/laravel-cors/config/cors.php] To [/config/cors.php]
Publishing complete.

# excel
composer require maatwebsite/excel
php artisan vendor:publish --provider="Maatwebsite\Excel\ExcelServiceProvider"



# 密码检查插件
# composer.phar require "schuppo/password-strength"

# 备份插件
composer.phar require spatie/laravel-backup
php artisan vendor:publish --provider="Spatie\Backup\BackupServiceProvider"
Copied File [/vendor/spatie/laravel-backup/config/backup.php] To [/config/backup.php]
Copied Directory [/vendor/spatie/laravel-backup/resources/lang] To [/resources/lang/vendor/backup]
Publishing complete.


# 队列控制面板
composer require laravel/horizon
php artisan horizon:install


# 微信开发需求
overtrue/laravel-wechat
文档:https://packagist.org/packages/overtrue/laravel-wechat

composer require "overtrue/laravel-wechat:~5.0"

//别名
'aliases' => [
    // ...
    'EasyWeChat' => Overtrue\LaravelWeChat\Facade::class,
],

php artisan vendor:publish --provider="Overtrue\LaravelWeChat\ServiceProvider"
每个模块基本都支持多账号,默认为 default。
注意:必须csrf去除


############################
############################
############################
############################

注意:以下都是dev的安装!!
# N+1 解决
composer.phar require beyondcode/laravel-query-detector --dev

php artisan vendor:publish --provider=BeyondCode\\QueryDetector\\QueryDetectorServiceProvider

Copied File [/vendor/beyondcode/laravel-query-detector/config/config.php] To [/config/querydetector.php]
Publishing complete.

# 调试工具 clockwork
composer.phar require itsgoingd/clockwork --dev


php artisan vendor:publish --provider=Clockwork\\Support\\Laravel\\ClockworkServiceProvider

Copied File [/vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/config/clockwork.php] To [/config/clockwork.php]
Publishing complete.

# ide help,方便编程
composer.phar require barryvdh/laravel-ide-helper --dev
参考
https://learnku.com/articles/10172/laravel-super-good-code-prompt-tool-laravel-ide-helper
php artisan ide-helper:generate
php artisan ide-helper:meta
php artisan ide-helper:models
最后一项选yes

# 假身。。分222证号生成器
composer.phar require jialeicui/faker-chinese-id-number --dev
# 把已有数据库表生成migrate文件,有用的工具。
composer require xethron/migrations-generator --dev




lavavel的版本是5.5
"require": {
        "php": ">=7.0.0",

         //跨域使用
        "barryvdh/laravel-cors": "0.11.3",
        
         // ide编程方便
          "barryvdh/laravel-ide-helper": "2.4.3",
        
           "caouecs/laravel-lang": "~3.0",
        
        // laravel-admin管理后台 
       "encore/laravel-admin": "^1.6",
        "fideloper/proxy": "~3.3",
        
        // laravel-admin 后台登陆加 验证码
         "james.xue/login-captcha": "1.8.1",
        
        // laravel框架自身
        "laravel/framework": "5.5.*",
        "laravel/tinker": "~1.0",
        "lcobucci/jwt": "3.2.5",
        "schuppo/password-strength": "1.11",
        
         // 备份数据库必装
         "spatie/laravel-backup": "5.12.1",
        
         // api开发必装
         "tymon/jwt-auth": "1.0.0-rc.4",
       
         // 支付神器,必装
         "yansongda/pay": "2.7.5"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "3.2.3",
        
        // 防止n+1开发神器。可以在json中输出。
        "beyondcode/laravel-query-detector": "^1.0",
        "filp/whoops": "~2.0",
        "fzaninotto/faker": "~1.4",
        
        // api开发必装
        "itsgoingd/clockwork": "3.1.4",
        "mockery/mockery": "~1.0",
        "phpunit/phpunit": "~6.0",
        "symfony/thanks": "^1.0"
    },


laravel的特点就是,把常用需求一网打尽,长期写laravel,人都变傻了,因为什么都有现成的插件。

相关标签: laravel 插件