bencomeau/artisan-make-view
Composer 安装命令:
composer require bencomeau/artisan-make-view
包简介
Create views, including "resource" views, using console commands.
README 文档
README
Introduction
Quickly create views and view resources from the Artisan console, saving a surprising amount of time.
Code Samples
Creating views is as easy as:
php artisan make:view user // creates --> index, create, show, edit views in the resources/views/user directory
php artisan make:view user.index // creates --> resources/views/user/index.blade.php
Using something other than blade templates?
php artisan make:view user.index -e twig // creates --> resources/views/index.twig
Want to use a view path you specified in config/view.php?
// If your config/view file looks like this:
'paths' => [
resource_path('views'),
resource_path('my-custom-view-folder')
],
// Then just pass the key you want to use, like this:
php artisan make:view user.index -p 1 // creates --> resources/my-custom-view-folder/index.blade.php
Install
To get started, use composer to require this package:
composer require bencomeau/artisan-make-view --dev
Then simply register the package's Service Provider in your app/Providers/AppServiceProvider.php file:
Note: Laravel
5.5and above uses Package Auto-Discovery; if you are using Laravel>= 5.5it is not necessary to manually add the service provider as shown below.
public function register()
{
if ($this->app->environment('local')) {
$this->app->register(\BenComeau\ArtisanMakeView\ArtisanMakeViewServiceProvider::class);
}
}
And you're ready to quickly generate views!
Usage
To list all command options
php artisan make:view --help
Make a single view by name, in dot notation
php artisan make:view user.index
Make a view resource by passing just the name of the resource
php artisan make:view user -r
Make a view with a custom extension
php artisan make:view user.index -e twig
Make a view and store it in another directory
Note: -p 1 refers to the value of array key of 1 in your config('view.paths') setting.
php artisan make:view user.index -p 1
Combine multiple options to fully-customize the view(s) being created
Note: this will create all resource views in your custom directory, with the twig extension.
php artisan make:view user -r -p 1 -e twig
License
Artisan Make View is open-sourced software licensed under the MIT license.
bencomeau/artisan-make-view 适用场景与选型建议
bencomeau/artisan-make-view 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 678 次下载、GitHub Stars 达 3, 最近一次更新时间为 2017 年 03 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「artisan」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bencomeau/artisan-make-view 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bencomeau/artisan-make-view 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bencomeau/artisan-make-view 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Collection of handy Laravel artisan commands that most projects needs
Additional artisan commands for Laravel
Enterprise-Grade Modular Architecture for Laravel Applications - A powerful Laravel package that revolutionizes application development with robust Service Repository Pattern, Dynamic Module Management, and 50+ Artisan commands for scalable, maintainable applications.
Generates Laravel Migrations from an existing database
Laravel Craftsman
Generate service and repository file and interface
统计信息
- 总下载量: 678
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-03-16