brunocfalcao/flame
Composer 安装命令:
composer require brunocfalcao/flame
包简介
Flame - A feature-driven development (FDD) UI framework for your Laravel applications
README 文档
README
About Flame
Flame is a Feature Development-driven framework that will improve the way you structure and develop your Laravel application features.
This free package will allow you to:
- Create your features organized in a standard code-convention way, each of them inside a directory.
- Create and re-use "intelligent" widgets, called Twinkles, that will make you improve your layout code structure.
- Render Panels and Twinkles automatically given the route action that it's being called at a request.
- Be able to execute Twinkle controller actions prior to its rendering on the screen.
- Structure your application as feature modules, having a much better code readability, structure and reusability!
Why Flame
I've built Flame because I was starting to have medium size web apps (like Laraning or Laraflash) with a lot of Blade views, Blade Components, etc. It was starting to be difficult to organize my features in a way that I could load data inside those views given for the respective controller action that I was running at a certain moment.
A thought came to me: "What if I have a way to know automatically what actions am I running and then automatically load my graphical layout accordingly to that action, reusing the layout and not just create more and more views?"
That's where Flame started. Flame will automate this behaviour for you. Let's see how.
Installation
You can install this package via composer using this command:
composer require brunocfalcao/flame
The package will automatically register itself (using auto-discover).
Next step is to publish the flame.php configuration file into your config folder.
php artisan vendor:publish --tag=flame-configuration
All done! 😄
How it works
The flame.php configuration file already have an entry to put all your features in the App\Flame\Features namespace.
Create a new feature using the following command:
php artisan make:feature
Select the "flame" namespace group, then create a "Manage Cars" feature, and the action "index". At the end, the route example that the command give you will be:
Route::get('manage-cars', '\App\Flame\Features\ManageCars\Controllers\ManageCarsController@index') ->name('manage-cars.index');
👉 Copy+Paste this route example to your web.php file (or other route file you're using with web middleware).
💾 A new folder "ManagesCars" is created inside your "app\Flame\Features" folder.
Feature "Manage Cars" file structure
+ ManageCars
+ Controllers
> ManageCarsController.php
> WelcomeController.php
+ Panels
> index.blade.php
+ Twinkles
> welcome.blade.php
Let's now see what was scaffolded on each of those files. The magic starts ❤️ !
Controllers/ManageCarsController.php
class ManageCarsController extends Controller { public function index() { return flame(); }
🎉 This is where you mapped your route file You just need to return the flame() helper so Flame will load your respective Panel and Twinkles for the "index" action. Meaning, if your Twinkles have the "index" action defined, they will run prior to the Panel content rendering.
In case you don't have a Panel with the same name, then it will fall back to default.blade.php. If you have a Panel with this name, it will be loaded for all of your actions that don't have a specific Panel action. Double sweet!
Panels/welcome.blade.php
@twinkle('welcome')
The Twinkle works like an "intelligent widget". It will render content defined in your Twinkes/ folder, given the argument passed. In this case, the Twinkle will load the "welcome.blade.php".
BUT! More magic happens ❤️ ...
Before rendering the Twinkle, it will try to find its own respective controller (studly case) name. In our case we do have it in the Controllers/WelcomeController.php, so let's check it:
Controllers/WelcomeController.php
class WelcomeController extends Controller { public function index() { return ['text' => 'Hi there! This is a Twinkle!']; }
Since there is the same action defined for the current route action running, it will use reflection to run the method and pass the data as an array. So you can then use it inside your Twinkle as a Blade variable. Meaning on this case, it will run the "index" method and return the data to the Welcome Twinkle.
The Twinkle methods also work with implicit binding. Meaning if you define your arguments from the route parameters they will be dynamically injected into your method arguments!
Current development status
- Finish core development.
- Finish identified issues/improvements for Alpha release 0.1.x.
- Close Alpha (0.1.x) release.
- Finish identified issues/improvements for Beta release 0.2.x.
- Close Beta (0.2.x) release.
- Test coverage > 90%.
- Finalize documentation.
- Finalize video tutorials.
- Release for General Public use.
Getting started
Flame creates a demo route on your /flame url. You can try it and should see:
This means that you have can see the Demo feature located in the Brunocfalcao\Flame\Features\Demo namespace.
Creating your first Feature
Simple as this. Just write the following command:
php artisan make:feature
Contributing
At the moment you don't need to contribute since Flame is still in development.
License
Waygou Flame is open-sourced software licensed under the MIT license.
brunocfalcao/flame 适用场景与选型建议
brunocfalcao/flame 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 59 次下载、GitHub Stars 达 3, 最近一次更新时间为 2019 年 04 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「php」 「laravel」 「flame」 「brunocfalcao」 「fdd」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 brunocfalcao/flame 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 brunocfalcao/flame 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 brunocfalcao/flame 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Alfabank REST API integration
High-performance, opinionated PHP 8 web framework with O(1) routing, parallel async MySQL, type-safe asset bridge, and React-island frontend
Zero-dependency raw PHP DNS resolver, domain-ownership verification, and intoDNS/MxToolbox-style diagnostics. Queries authoritative nameservers directly over sockets — never trusts the recursive cache for ownership checks.
Laravel package for Accurate Online API integration.
The skeleton application for the Geoffrey agent framework.
统计信息
- 总下载量: 59
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 3
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-10