google-gemini-php/laravel

⚡️ Gemini PHP for Laravel is a community-maintained PHP API client that allows you to interact with the Gemini AI API.

What it solves

This project provides a native integration for the Google Gemini API within the Laravel PHP framework. It eliminates the need for developers to manually handle HTTP requests, authentication, and response parsing when building AI-powered features in Laravel applications.

How it works

It acts as a wrapper around the google-gemini-php/client library, exposing the Gemini API through a familiar Laravel facade. It includes built-in support for Laravel's dependency injection container, configuration management via .env files, and testing utilities, including a fake client to mock API responses during development.

Who it’s for

This package is designed for PHP developers using the Laravel framework who want to integrate Google's Gemini generative AI models into their web applications.

Highlights

  • Full support for multimodal inputs including text, images, video, audio, and documents.
  • Built-in helpers for advanced features like function calling, structured JSON output, and system instructions.
  • Native support for streaming responses, chat history management, and token counting.
  • Includes a dedicated testing suite with a fake client to simplify unit and feature testing.
  • Provides tools for managing context caching, file search stores, and embeddings directly from the application code.

Related

  • Project
  • Project
  • Project
  • Project