laravel

作者 grok-php已验证

Seamlessly integrate Grok AI into Laravel applications with an elegant, developer-friendly package. Leverage powerful AI models for chat, automation, and NLP, while maintaining Laravel's expressive simplicity.

167
Stars
12
Forks
PHP
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/grok-php/laravel

快速入门

使用 laravel 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

🧠 Grok AI Laravel

GrokAI Laravel

A Laravel integration for the GrokPHP Client, designed to effortlessly incorporate Grok AI into Laravel applications with a clean and intuitive API.
Utilize advanced AI models for chat, automation, and natural language processing, all while preserving Laravel's simplicity and elegance.

Latest Version PHP Version Laravel Version Total Downloads GitHub Workflow Status License


Table of Contents


Features

  • Seamless Laravel Integration – Works with Laravel 10, 11, and 12
  • Simple API Client – Access Grok AI models with a clean and intuitive API
  • Supports Chat & Vision – Send both text and image-based requests
  • Streaming Capable – Enable real-time AI responses
  • Configurable Defaults – Set model, temperature, and timeout via config

Installation

Install via Composer:

composer require grok-php/laravel

After installation, run the setup command:

php artisan grok:install

This command will:

  • Publish the configuration file (config/grok.php).
  • Add necessary environment variables to .env.

Add your API key in .env:

GROK_API_KEY=your-api-key

Quick Start

Chat API

use GrokPHP\Laravel\Facades\GrokAI;
use GrokPHP\Client\Config\ChatOptions;
use GrokPHP\Client\Enums\Model;

$response = GrokAI::chat(
    [['role' => 'user', 'content' => 'Hello Grok!']],
    new ChatOptions(model: Model::GROK_2)
);

echo $response->content();

Vision Analysis (Image Recognition)

$response = GrokAI::vision()->analyze(
    'https://example.com/sample.jpg',
    'Describe this image'
);

echo $response->content();

Error Handling

All errors are wrapped in the GrokException class:

use GrokPHP\Client\Exceptions\GrokException;

try {
    $response = GrokAI::chat(
        [['role' => 'user', 'content' => 'Hello!']]
    );
    echo $response->content();
} catch (GrokException $e) {
    echo "Error: " . $e->getMessage();
}

Available Grok AI Models

Model EnumAPI Model NameDescription
Model::GROK_VISION_BETAgrok-vision-betaExperimental vision-enabled model
Model::GROK_2_VISIONgrok-2-visionAdvanced multi-modal vision model
Model::GROK_2_VISION_LATESTgrok-2-vision-latestLatest iteration of Grok vision models
Model::GROK_2_VISION_1212grok-2-vision-1212Enhanced vision model with performance improvements
Model::GROK_2_1212grok-2-1212Optimized chat model
Model::GROK_2grok-2Default general-purpose Grok model
Model::GROK_2_LATESTgrok-2-latestLatest iteration of Grok-2
Model::GROK_BETAgrok-betaExperimental beta model

Default model used: Model::GROK_2


Streaming Responses

Enable real-time AI responses by setting stream: true:

$response = GrokAI::chat(
    [['role' => 'user', 'content' => 'Tell me a story']],
    new ChatOptions(model: Model::GROK_2, stream: true)
);

Streaming is useful for chatbots, assistants, and real-time applications.


Testing

To run PHPUnit tests, copy the phpunit.xml.dist file to phpunit.xml and set your API key.

cp phpunit.xml.dist phpunit.xml
<php>
    <env name="GROK_API_KEY" value="your-grok-api-key"/>
</php>

Now, run the tests:

composer test

Security

If you discover a security vulnerability, please report it via email:
thefeqy@gmail.com


Contributing

Check out CONTRIBUTING.md for guidelines on how to contribute.


License

This package is open-source software licensed under the MIT License.

常见问题

What is laravel?

laravel is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by grok-php. Seamlessly integrate Grok AI into Laravel applications with an elegant, developer-friendly package. Leverage powerful AI models for chat, automation, and NLP, while maintaining Laravel's expressive simplicity. It has 167 GitHub stars.

Is laravel safe to use?

Yes. laravel passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install laravel?

Clone the repository with "git clone https://github.com/grok-php/laravel" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is laravel written in?

laravel is primarily written in PHP. It is open-source under grok-php on GitHub, so you can review or fork the full source.

Are there alternatives to laravel?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh laravel against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情