Download the PHP package grok-php/laravel without Composer
On this page you can find all versions of the php package grok-php/laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download grok-php/laravel
More information about grok-php/laravel
Files in grok-php/laravel
Package laravel
Short Description 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.
License MIT
Homepage https://github.com/grok-php/laravel
Informations about the package laravel
🧠 Grok AI 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.
Table of Contents
- Features
- Installation
- Quick Start
- Chat API
- Vision Analysis
- Error Handling
- Available Grok AI Models
- Streaming Responses
- Testing
- Security
- Contributing
- License
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:
After installation, run the setup command:
This command will:
- Publish the configuration file (
config/grok.php
). - Add necessary environment variables to
.env
.
Add your API key in .env
:
Quick Start
Chat API
Vision Analysis (Image Recognition)
Error Handling
All errors are wrapped in the GrokException
class:
Available Grok AI Models
Model Enum | API Model Name | Description |
---|---|---|
Model::GROK_VISION_BETA |
grok-vision-beta | Experimental vision-enabled model |
Model::GROK_2_VISION |
grok-2-vision | Advanced multi-modal vision model |
Model::GROK_2_VISION_LATEST |
grok-2-vision-latest | Latest iteration of Grok vision models |
Model::GROK_2_VISION_1212 |
grok-2-vision-1212 | Enhanced vision model with performance improvements |
Model::GROK_2_1212 |
grok-2-1212 | Optimized chat model |
Model::GROK_2 |
grok-2 | Default general-purpose Grok model |
Model::GROK_2_LATEST |
grok-2-latest | Latest iteration of Grok-2 |
Model::GROK_BETA |
grok-beta | Experimental beta model |
Default model used: Model::GROK_2
Streaming Responses
Enable real-time AI responses by setting 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.
Now, run the tests:
Security
If you discover a security vulnerability, please report it via email:
[email protected]
Contributing
Check out CONTRIBUTING.md for guidelines on how to contribute.
License
This package is open-source software licensed under the MIT License.
All versions of laravel with dependencies
laravel/framework Version ^10.0|^11.0|^12.0
grok-php/client Version ^1.3