Can
Be Better

Laravel 5 composer 拓展

laravel-ide-helper

作用

实现自动完成、代码跟踪的支持

安装

composer require barryvdh/laravel-ide-helper

然后在config/app.php的providers中添加

Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,

然后执行以下命令:

php artisan clear-compiled
php artisan ide-helper:generate
php artisan optimize
查看项目根目录是否生成了_ide_helper.php,生成 了表面此时支持代码补全功能了。

laravel-debugbar

作用

在页面下方展示Debug框(开启Debug模式)

安装

composer require barryvdh/laravel-debugbar

Laravel Setting

安装

  1. composer require anlutro/l4-settings
  2. Add anlutro\LaravelSettings\ServiceProvider to the array of providers in config/app.php.
  3. Publish the config file by running php artisan config:publish anlutro/l4-settings (Laravel 4.x) or php artisan vendor:publish (Laravel 5.x). The config file will give you control over which storage engine to use as well as some storage-specific settings.
  4. Optional: add 'Setting' => 'anlutro\LaravelSettings\Facade' to the array of aliases in config/app.php.

使用

You can either access the setting store via its facade or inject it by type-hinting towards the abstract class anlutro\LaravelSettings\SettingStore.

<?php
Setting::set('foo', 'bar');
Setting::get('foo', 'default value');
Setting::get('nested.element');
Setting::forget('foo');
$settings = Setting::all();
?>

Call Setting::save() explicitly to save changes made.

不开启评论,如有问题疑问请发邮件。i@ltq.im最长的路 » Laravel 5 composer 拓展

评论 抢沙发

评论前必须登录!