juaniquillo/laravel-backend-component
Composer 安装命令:
composer require juaniquillo/laravel-backend-component
包简介
Use Laravel component using php classes
README 文档
README
A package that simplifies the creation of dynamic, class-based Laravel components.
This package allows you to build complex, reusable UI components in PHP, making your backend and frontend integration seamless.
Note
About this fork.
This repository is a fork of Chat-Agency/laravel-backend-component. I worked on this repository while I was working with that company and decided to fork it and take ownership of it.
View the full documentation (In Progress)
Tip
Laravel Boost Skill
If you use Laravel Boost, install the AI skill:
php artisan boost:add-skill https://github.com/juaniquillo/laravel-backend-component
Install the package via Composer:
composer require juaniquillo/laravel-backend-component
To use the package’s Tailwind themes, configure Tailwind to scan the package's Blade files. The method differs slightly between Tailwind versions:
Tailwind CSS v3:
Add the package's view path to the content array in your tailwind.config.js file:
// tailwind.config.js export default { content: [ './vendor/juaniquillo/laravel-backend-component/resources/views/**/*.blade.php', // <- Add this line // other paths ], // ... };
Tailwind CSS v4:
In your main CSS file (e.g., resources/css/app.css), use the @source at-rule to include the package's view path:
@import 'tailwindcss'; /* Add the path for the package's views */ @source '../../vendor/juaniquillo/laravel-backend-component/resources/views/**/*.blade.php';
Basic use
Use the MainBackendComponent class to construct your component. Pass the component name/path as the first parameter:
use Juaniquillo\BackendComponents\MainBackendComponent; $button = new MainBackendComponent('inline.button');
Alternatively, builders and an enum are available to streamline instance creation:
use Juaniquillo\BackendComponents\Builders\ComponentBuilder; use Juaniquillo\BackendComponents\Enums\ComponentEnum; $button = ComponentBuilder::make(ComponentEnum::BUTTON);
Since the main component class implements Laravel’s Htmlable interface, you can output the component using simple Blade syntax—no escaping needed:
{{-- This will render the button's HTML --}} {{ $button }}
Components can be composed with other components:
use Juaniquillo\BackendComponents\Builders\ComponentBuilder; use Juaniquillo\BackendComponents\Enums\ComponentEnum; $divWithButton = ComponentBuilder::make(ComponentEnum::DIV) ->setContent( ComponentBuilder::make(ComponentEnum::BUTTON) ->setContent('Click me!') );
Theming
The package supports theming, primarily designed for use with Tailwind CSS classes. All themes are stored inside resources/views/_themes/tailwind by default, ensuring they are automatically discovered by Tailwind's scanner.
You can apply a theme using the setTheme method:
use Juaniquillo\BackendComponents\Builders\ComponentBuilder; use Juaniquillo\BackendComponents\Enums\ComponentEnum; $button = ComponentBuilder::make(ComponentEnum::BUTTON) ->setTheme('theme_file', 'theme_name');
Serialization
Component trees can be serialized to arrays and restored, preserving attributes, content, themes, and Livewire state:
use Juaniquillo\BackendComponents\Factories\ComponentFactory; // Serialize the entire component tree $array = $component->toArray(); // Restore it later $restored = ComponentFactory::fromArray($array);
This works recursively for nested content, making it useful for caching, session storage, or API responses.
Tests
Run tests using Composer:
composer test
If you're submitting a pull request, use the qa command—it runs phpstan, pint, and tests. These are the same checks performed in GitHub Actions
composer qa
License
This package is licensed under the MIT License.
juaniquillo/laravel-backend-component 适用场景与选型建议
juaniquillo/laravel-backend-component 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 373 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「component」 「laravel」 「laravel-backend-component」 「Juaniquillo」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 juaniquillo/laravel-backend-component 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 juaniquillo/laravel-backend-component 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 juaniquillo/laravel-backend-component 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
FSi DataSource Component
Priveate for SkeekS CMS
Module for bootstrapping components in the Monolith framework.
qscmf modal button download
Use Laravel component using php classes
Alfabank REST API integration
统计信息
- 总下载量: 373
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-22