jpcaparas/laravel-n8n-client
Composer 安装命令:
composer require jpcaparas/laravel-n8n-client
包简介
A Laravel library that interfaces with the self-hosted n8n.io REST API
README 文档
README
A Laravel library that interfaces with the self-hosted n8n REST API.
Installation
You can install the package via Composer:
composer require jpcaparas/laravel-n8n-client
Publish the configuration file:
php artisan vendor:publish --provider="JPCaparas\N8N\N8NServiceProvider" --tag="config"
Set these credentials inside your .env file:
N8N_BASE_URI=http://[your_n8n_instance]:[your_n8n_port]
N8N_API_TOKEN=[your_n8n_api_token]
Local testing
If you want to interact with the package locally, you can use the Laravel skeleton provided by orchestra/testbench and its associated Tinker REPL:
- Publish the configuration file to the Laravel skeleton.
composer test:publish
- Modify
.envAPI credentials on the skeleton as needed:
N8N_BASE_URI=http://localhost:5678 N8N_API_TOKEN=[your_n8n_api_token]
- Enter the Tinker REPL:
composer test:tinker
- Create an instance of the N8N client:
$n8n = app(\JPCaparas\N8N\N8NClient::class);
- Make API requests using the N8N client:
$response = $n8n->get('valid-endpoint'); $response = $n8n->post('valid-endpoint', ['data' => 'value']);
There are also convenience methods for the most common API endpoints:
$response = $n8n->getWorkflows(); $response = $n8n->getWorkflow('workflow-id'); $response = $n8n->createWorkflow(['name' => 'New Workflow']); $response = $n8n->updateWorkflow('workflow-id', ['name' => 'Updated Workflow']);
Tests
composer test
License
MIT
jpcaparas/laravel-n8n-client 适用场景与选型建议
jpcaparas/laravel-n8n-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.42k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2025 年 01 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 jpcaparas/laravel-n8n-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jpcaparas/laravel-n8n-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.42k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-07