cleaniquecoders / blade-plus-plus
此包已被弃用且不再维护。未建议替代包。
扩展 Laravel Blade 指令
v2.1.2
2020-03-22 16:21 UTC
Requires
- php: >=7.2
- illuminate/filesystem: ^5.5|^5.6|^5.7|^5.8|^6.0|^7.0
- illuminate/support: ^5.5|^5.6|^5.7|^5.8|^6.0|^7.0
- symfony/console: ~4.0|~5.0
- symfony/filesystem: ~4.0|~5.0
Requires (Dev)
- orchestra/testbench: 3.5.*|3.6.*|3.7.*|3.8.*|4.*|5.*
- phpunit/phpunit: ^6.5|^7.0|^8.0
This package is auto-updated.
Last update: 2020-10-02 20:05:55 UTC
README
Laravel Blade 指令
扩展 Laravel Blade 指令
安装
$ composer require cleaniquecoders/blade-plus-plus
$ php artisan vendor:publish --provider="CleaniqueCoders\BladePlusPlus\BladePlusPlusServiceProvider"
从版本 2.1.0 开始,在发布资源时,将发布到
resources/views/vendor/blade-plus-plus
而不是resources/views/vendor/laravel-blade-directives
。请考虑更新您的代码。
使用方法
基于类别的可用指令
动作
@baseAction([
'label' => 'Google',
'href' => 'https://google.com',
'icon' => 'fa-google'
])
@createAction([
'label' => 'New User',
'href' => route('users.create'),
])
@editAction([
'label' => 'Edit User',
'href' => route('users.edit', 1),
])
@showAction([
'label' => 'Show User',
'href' => route('users.show', 1),
])
@destroyAction([
'label' => 'Delete User',
'href' => route('users.destroy', 1),
'id' => 'destroy-user-1'
])
卡片
@card
@slot('card_title')
@endslot
@slot('card_body')
@endslot
@slot('card_footer')
@endslot
@endcard
表单
@input([
'id' => 'name',
'name' => 'name',
])
@input([
'id' => 'email',
'name' => 'email',
'type' => 'email'
])
@input([
'id' => 'password',
'name' => 'password',
'type' => 'password'
])
@input([
'id' => 'password_confirmation',
'name' => 'password_confirmation',
'type' => 'password'
])
布局
@container
@row
@col('col-6')
@endcol
@col('col-6')
@endcol
@endrow
@endcontainer
模态框
@modal
@slot('modal_body')
@endslot
@slot('modal_footer')
@endslot
@endmodal
表格
@table
@slot('thead')
@endslot
@slot('tbody')
@endslot
@slot('tfooter')
@endslot
@endtable
其他
@appName
@icon('fa fa-search')
测试
运行以下命令
$ vendor/bin/phpunit --testdox --verbose
贡献
感谢您考虑为 LaravelBladeDirectives
做贡献!
错误报告
为了鼓励积极的协作,强烈建议提交拉取请求,而不仅仅是错误报告。"错误报告"也可以以包含失败测试的拉取请求的形式发送。
然而,如果您提交错误报告,您的问题应包含标题和对问题的清晰描述。您还应包括尽可能多的相关信息和一个展示问题的代码示例。错误报告的目标是使您和其他人能够轻松地复制错误并开发解决方案。
记住,错误报告是在希望有相同问题的人能够与您合作解决问题的情况下创建的。不要期望错误报告会自动看到任何活动,或者其他人会立即修复它。创建错误报告的目的是帮助您和其他人开始解决问题的过程。
编码风格
LaravelBladeDirectives
遵循 PSR-2 编码标准和 PSR-4 自动加载标准。
您可以使用 PHP CS Fixer 来保持标准化。PHP CS Fixer 配置可以在 .php_cs
中找到。
许可
此软件包是开源软件,根据 MIT 许可 许可。