barryvdh/laravel-debugbar
1. 下载composer包
composer require barryvdh/laravel-debugbar
2. 配置注入
-
在config/app.php中的
providers属性添加Barryvdh\Debugbar\ServiceProvider::class, -
在config/app.php中的
aliases属性添加'Debugbar' => Barryvdh\Debugbar\Facade::class,
3. 发布
php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"
barryvdh/laravel-ide-helper
1. 下载插件包
composer require barryvdh/laravel-ide-helper
2. 注入
在config/app.php里面的providers里面添加
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
3. 使用
php artisan ide-helper:generate- 为 Facades 生成注释php artisan ide-helper:models- 为数据模型生成注释php artisan ide-helper:meta- 生成 PhpStorm Meta file
xethron/migrations-generator
安装依赖包
composer require xethron/migrations-generator
配置文件
在config/app.php 里面的 'providers' => []加上两行代码
Way\Generators\GeneratorsServiceProvider::class,
Xethron\MigrationsGenerator\MigrationsGeneratorServiceProvider::class,
运行命令
php artisan migrate:generate
hieu-le/active
mews/captcha
下载
composer require mews/captcha
配置
- 在app.config的
providers属性添加
Mews\Captcha\CaptchaServiceProvider::class,
- 运行命名生成配置文件
config/captcha.php
php artisan vendor:publish
- 配置captcha.php
return [
'default' => [
'length' => 4, //验证码长度
'width' => 120,
'height' => 36,
'quality' => 90,
'bgImage' => false, //背景图片
'bgColor' => '#e9ecef', //背景颜色
'math' => false, //使用数学计算方式
],
// ...
];
使用
- 生成图片
captcha();或Captcha::create(); - 生成url
captcha_src();或Captcha::src(); - 生成html
captcha_img();或Captcha::img(); - 切换配置文件
captcha_img('flat');或Captcha::img('inverse');
校验方式
$rules = ['captcha' => 'required|captcha'];