PHPackages                             azlanali076/image-generator - 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. [Image &amp; Media](/categories/media)
4. /
5. azlanali076/image-generator

ActiveLibrary[Image &amp; Media](/categories/media)

azlanali076/image-generator
===========================

A Laravel package for generating images using the OpenAI API. This package provides an easy-to-use interface for interacting with the OpenAI API to generate images based on text prompts.

1.0.1(1y ago)09MITPHPPHP ^7.4|^8.0|^8.1

Since Jul 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/azlanali076/image-generator)[ Packagist](https://packagist.org/packages/azlanali076/image-generator)[ RSS](/packages/azlanali076-image-generator/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Laravel Image Generator Package
===============================

[](#laravel-image-generator-package)

A Laravel package for generating images using the OpenAI API. This package provides an easy-to-use interface for interacting with the OpenAI API to generate images based on text prompts.

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

[](#installation)

You can install the package via Composer:

```
composer require azlanali076/image-generator
```

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

[](#configuration)

### 1. Publish the Configuration File

[](#1-publish-the-configuration-file)

Publish the configuration file to your application's config directory:

```
php artisan vendor:publish --provider="Azlanali076\ImageGenerator\ImageGeneratorServiceProvider"
```

### 2. Set Up Your API Key

[](#2-set-up-your-api-key)

Make sure to add your API key to your `.env` file:

```
OPENAI_API_KEY=your-openai-api-key
```

Usage
-----

[](#usage)

You can use the package by calling the `generate` method on the facade `ImageGenerator`.

```
use Azlanali076\ImageGenerator\Facades\ImageGenerator;

// Generate an image
$imageResponse = ImageGenerator::generate(
    "A Cute White Cat"
);

// Check if the response is successful
if ($imageResponse['success']) {
    // Retrieve the image URL
    $url = $imageResponse['data'][0]['url'];
    echo "Image URL: " . $url;
} else {
    // Handle the error
    echo "Error: " . $imageResponse['message'];
}
```

### Constants

[](#constants)

- `ImageGenerator::QUALITY_STANDARD` Constant for the `standard` image quality.
- `ImageGenerator::QUALITY_HD` Constant for the `hd` image quality.
- `ImageGenerator::STYLE_NATURAL` Constant for the `natural` image style.
- `ImageGenerator::STYLE_VIVID` Constant for the `vivid` image style.
- `ImageGenerator::RESPONSE_FORMAT_URL` Constant for the `url` response format.
- `ImageGenerator::RESPONSE_FORMAT_BASE64` Constant for the `b64_json` (base 64) response format.

### Parameters

[](#parameters)

- `string $prompt` The text prompt for generating the image.
- `int|null $width` The width of the generated image (default is 1024 if null).
- `int|null $height` The height of the generated image (default is 1024 if null).
- `string|null $quality` The quality of the image (default is 'standard').
- `string|null $style` The style of the image (default is 'vivid').
- `string|null $responseFormat` The format of the response (default is 'url').

### Response Format

[](#response-format)

- `success` A boolean indicating whether the request was successful.
- `data` The data returned from the API (includes the image URL if successful).
- `message` An error message if the request was not successful.
- `code` An error code if the request was not successful.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

709d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/43521863?v=4)[Syed Azlan Ali](/maintainers/azlanali076)[@azlanali076](https://github.com/azlanali076)

---

Top Contributors

[![azlanali076](https://avatars.githubusercontent.com/u/43521863?v=4)](https://github.com/azlanali076 "azlanali076 (10 commits)")

### Embed Badge

![Health badge](/badges/azlanali076-image-generator/health.svg)

```
[![Health](https://phpackages.com/badges/azlanali076-image-generator/health.svg)](https://phpackages.com/packages/azlanali076-image-generator)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.0k](/packages/craftcms-cms)[illuminate/http

The Illuminate Http package.

11937.9M6.8k](/packages/illuminate-http)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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