PHPackages                             scott/laravel-gemini - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. scott/laravel-gemini

ActiveLibrary

scott/laravel-gemini
====================

A php package for Gemini ai

v1.0.1(2y ago)9353[3 issues](https://github.com/Tresor-Kasenda/laravel-gemini/issues)MITPHP

Since Dec 20Pushed 2y ago2 watchersCompare

[ Source](https://github.com/Tresor-Kasenda/laravel-gemini)[ Packagist](https://packagist.org/packages/scott/laravel-gemini)[ RSS](/packages/scott-laravel-gemini/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

Laravel Gemini
==============

[](#laravel-gemini)

[![Latest Version on Packagist](https://camo.githubusercontent.com/45972f822b42fe4ccfeb4a10ba37ce88058a6dffea7d28900d71714124c68939/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73636f74742f6c61726176656c2d67656d696e692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/scott/laravel-gemini)![GitHub Tests Action Status](https://camo.githubusercontent.com/d8d9f9f7676656ed1f18b707972bcbff2eccf561870804be07960d16886b75ac/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f73636f74742f6c61726176656c2d67656d696e692f72756e2d74657374733f6c6162656c3d7465737473)[![Total Downloads](https://camo.githubusercontent.com/f592137112f1b412c33d5d087ae037fa7196ed3e776e077e444521e0502ded1a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73636f74742f6c61726176656c2d67656d696e692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/scott/laravel-gemini)

This package provides a simple way to use the [Gemini API](https://docs.gemini.com/rest-api/) in your Laravel applications. The Laravel Gemini package provides a convenient interface for interacting with the Gemini API to generate text based on a given prompt. This documentation outlines how to use the `GeminiAi` class, its methods, and configuration.

Get Started
-----------

[](#get-started)

> **Requires [PHP 8.1+](https://php.net/releases/)**

First, install GeminiAI via the [Composer](https://getcomposer.org/) package manager:

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require scott/laravel-gemini
```

Configuration
-------------

[](#configuration)

The Laravel Gemini package can be configured using environment variables. The following environment variables are available:

This will create a `config/gemini.php` configuration file in your project, which you can modify to your needs using environment variables. Blank environment variables for the Google gemini API key and organization id are already appended to your `.env` file.

```
GOOGLE_GEMINI_API_KEY=
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Scott\LaravelGemini\LaravelGeminiServiceProvider" --tag="laravel-gemini-config"
```

Usage
-----

[](#usage)

To use the Laravel Gemini package for text generation, follow these steps:

1. **Create a new instance of Gemini AI:**

```
use Scott\LaravelGemini\GeminiAi;
$prompt = GeminiAi::models('gemini-pro')
    ->generateText('I am a web developer');
```

2. **Call the `generateText` method:**

```
echo $prompt;
```

Testing
-------

[](#testing)

```
composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email instead of using the issue tracker.

Credits
-------

[](#credits)

- [All Contributors](../../contributors)
- [Laravel Package Boilerplate](https://laravelpackageboilerplate.com)
- [Gemini API](https://docs.gemini.com/rest-api/)
- [Laravel](https://laravel.com)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

871d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c1881faab5151123abdf9072ab481111c6150115b610dd0f6f34c0d3f66db43?d=identicon)[Scott-Tresor](/maintainers/Scott-Tresor)

---

Top Contributors

[![Tresor-Kasenda](https://avatars.githubusercontent.com/u/34010260?v=4)](https://github.com/Tresor-Kasenda "Tresor-Kasenda (17 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/scott-laravel-gemini/health.svg)

```
[![Health](https://phpackages.com/badges/scott-laravel-gemini/health.svg)](https://phpackages.com/packages/scott-laravel-gemini)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
