Download the PHP package noxsi/laravel-gemininano without Composer

On this page you can find all versions of the php package noxsi/laravel-gemininano. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-gemininano

GeminiNano Laravel ⚡

GeminiNano Laravel is an elegant Laravel SDK for generating images with Google Gemini (e.g. gemini-2.5-flash-image).
It wraps the official Gemini REST API in a clean, resource-based, Laravel-friendly API and can automatically:

Under the hood it calls: POST https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent with a text prompt and extracts the inline base64 image data.


✨ Features


📦 Installation

Install the package via Composer:

For local development using a path repository, point your Laravel app’s composer.json to your package directory and then run the command above.


⚙️ Configuration

Publish the config file:

This will create config/gemininano.php.

.env

Add your Gemini API configuration:

Config file overview


🚀 Usage

You can use the package either via the client or the facade.

1. Basic usage with the Facade

2. Using the Client directly (DI-friendly)


🧠 How the image pipeline works

When you call:

the package:

  1. Builds a request body compatible with the official Gemini API:

  2. Sends a POST request to:

    with headers:

    • x-goog-api-key: <your-api-key>
    • Content-Type: application/json
  3. Extracts the base64-encoded image data from the response:

    • candidates[0].content.parts[*].inlineData.data
    • (also supports snake_case inline_data.data for safety)
  4. Wraps everything in a GenerateResponse object.

  5. When you call ->result():

    • If config('gemininano.store') === true
      → the package decodes the base64 string, stores it as a .png via Storage::disk(...), and returns the public URL.

    • If config('gemininano.store') === false
      → it simply returns the raw base64 string.

You can always access the raw data:


🎛 Advanced usage

Passing extra options to Gemini

You can pass additional options like generationConfig, safetySettings, etc. They are merged into the root payload:

Using an input image (multimodal / inline_data)

You can optionally send an input image along with your text prompt.
Internally this builds a payload like:

Example:

Note: imagePath must point to a readable image file. The package will base64-encode the file and send it as inline_data to the Gemini API.

Returning base64 for an API endpoint

For API scenarios where you don’t want to store anything:

Then in your controller:


🧪 Testing

If you are testing within your Laravel app that uses the package, you can mock the HTTP layer as usual:

If you’re testing the package itself, you can use Pest; the package is designed to run in a standard Laravel test environment.


🧱 Requirements


🔧 Local development (using a path repository)

If you’re developing this package locally, you can hook it into a test Laravel application via a path repository:

In your Laravel app’s composer.json:

Then:

Any changes you make in the package directory will be reflected in your Laravel app (after composer dump-autoload when adding/removing classes).


📜 Changelog

All notable changes to this package will be documented in the CHANGELOG.md file.


🤝 Contributing

Pull requests are welcome!

If you plan something bigger (new resources, breaking changes, etc.), open an issue first to discuss your idea.

Steps:

  1. Fork the repo
  2. Create your feature branch: git checkout -b feature/my-awesome-feature
  3. Run tests & formatter: composer test / composer lint
  4. Commit your changes and open a PR

📄 License

This package is open-sourced software licensed under the MIT license.


All versions of laravel-gemininano with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4.0
illuminate/filesystem Version ^12.41
illuminate/http Version ^12.41
illuminate/support Version ^12.41
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package noxsi/laravel-gemininano contains the following files

Loading the files please wait ...