定制 hristijans/spatie-agent-tools 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hristijans/spatie-agent-tools

Composer 安装命令:

composer require hristijans/spatie-agent-tools

包简介

Laravel AI SDK agent tools for Spatie packages

README 文档

README

Latest Version on Packagist

Laravel AI SDK agent tools for Spatie packages. Drop-in tools that give your AI agents the ability to query and interact with data managed by popular Spatie packages — no glue code required.

Requirements

Each tool requires its corresponding Spatie package to be installed. See the individual tool documentation for specific package requirements.

Installation

composer require hristijans/spatie-agent-tools

The package auto-discovers its service provider — no manual registration needed.

Available Tools

Tool Spatie Package Description
QueryActivityLogTool spatie/laravel-activitylog Query and filter activity log entries
QueryPermissionsTool spatie/laravel-permission Query roles, permissions, and user access
QueryMediaLibraryTool spatie/laravel-medialibrary Query and filter media files
QueryTagsTool spatie/laravel-tags Query tags, tag types, and tagged models
QueryTranslatableTool spatie/laravel-translatable Query model translations across locales
QuerySettingsTool spatie/laravel-settings Query application settings groups and values

Quick Start

Register the tools you need on your Laravel AI SDK agent:

use Hristijans\SpatieAgentTools\Tools\QueryActivityLogTool;
use Hristijans\SpatieAgentTools\Tools\QueryMediaLibraryTool;
use Hristijans\SpatieAgentTools\Tools\QueryPermissionsTool;
use Hristijans\SpatieAgentTools\Tools\QuerySettingsTool;
use Hristijans\SpatieAgentTools\Tools\QueryTagsTool;
use Hristijans\SpatieAgentTools\Tools\QueryTranslatableTool;
use Laravel\Ai\Agents\Agent;
use Laravel\Ai\Contracts\HasTools;

class MyAgent implements Agent, HasTools
{
    public function tools(): iterable
    {
        return [
            new QueryActivityLogTool,
            new QueryPermissionsTool,
            new QueryMediaLibraryTool,
            new QueryTagsTool,
            new QueryTranslatableTool,
            new QuerySettingsTool,
        ];
    }
}

Your agent can now query activity logs, roles and permissions, media files, tags, translations, and application settings through natural language — no extra configuration required.

Tip: You only need to register the tools for packages you have installed. If you only use spatie/laravel-permission, just register QueryPermissionsTool.

Documentation

Comprehensive documentation for each tool is available in the docs/ directory:

  • Activity Log Tool — Query and filter activity log entries by causer, subject, log name, description, and date range.
  • Laravel Permission Tool — List roles and permissions, look up what a role can do, find which roles hold a permission, and audit a user's full access breakdown.
  • Media Library Tool — Query media files by model, collection, mime type, disk, file name, size, and upload date.
  • Tags Tool — List and search tags, discover tag types, find tags on a model, and look up which models use a specific tag.
  • Translatable Tool — Get translations for a model, check which locales exist, find missing translations, and discover models with a specific locale.
  • Settings Tool — List registered settings groups, read current values, inspect individual properties, and check locked status.

License

The MIT License (MIT). Please see License File for more information.

hristijans/spatie-agent-tools 适用场景与选型建议

hristijans/spatie-agent-tools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 4, 最近一次更新时间为 2026 年 04 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「tools」 「laravel」 「Agent」 「spatie」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 hristijans/spatie-agent-tools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 hristijans/spatie-agent-tools 我们能提供哪些服务?
定制开发 / 二次开发

基于 hristijans/spatie-agent-tools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-03