PHPackages                             blinq/synth - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. blinq/synth

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

blinq/synth
===========

This is my package synth

v1.0.7(2y ago)28014.4k↓35.7%19[2 PRs](https://github.com/blinq-dev/laravel-synth/pulls)MITPHPPHP ^8.1

Since Jun 19Pushed 2y ago4 watchersCompare

[ Source](https://github.com/blinq-dev/laravel-synth)[ Packagist](https://packagist.org/packages/blinq/synth)[ Docs](https://github.com/blinq/synth)[ RSS](/packages/blinq-synth/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (13)Versions (11)Used By (0)

Synth for Laravel
=================

[](#synth-for-laravel)

(Not an official Laravel package)

[![Synth for Laravel](https://private-user-images.githubusercontent.com/168357/247121261-7dccb9ba-1db5-4d6f-9a41-fde6f99a2446.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQzODE2ODcsIm5iZiI6MTc3NDM4MTM4NywicGF0aCI6Ii8xNjgzNTcvMjQ3MTIxMjYxLTdkY2NiOWJhLTFkYjUtNGQ2Zi05YTQxLWZkZTZmOTlhMjQ0Ni5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzI0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMyNFQxOTQzMDdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03ZGJkNWEwODMxOGM1NWI3MTZiOWM2ZjgyY2MwN2U0NTBkYzVmNDFmMjFiMDFmMjU0OTM1ZWY1MDE3MDZhZWQ5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.okBiAgSzfdBPfq4M37KGiaxVYxiIJHuPrO5GsiBd8_g)](https://private-user-images.githubusercontent.com/168357/247121261-7dccb9ba-1db5-4d6f-9a41-fde6f99a2446.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQzODE2ODcsIm5iZiI6MTc3NDM4MTM4NywicGF0aCI6Ii8xNjgzNTcvMjQ3MTIxMjYxLTdkY2NiOWJhLTFkYjUtNGQ2Zi05YTQxLWZkZTZmOTlhMjQ0Ni5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzI0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMyNFQxOTQzMDdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03ZGJkNWEwODMxOGM1NWI3MTZiOWM2ZjgyY2MwN2U0NTBkYzVmNDFmMjFiMDFmMjU0OTM1ZWY1MDE3MDZhZWQ5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.okBiAgSzfdBPfq4M37KGiaxVYxiIJHuPrO5GsiBd8_g)Synth is a Laravel tool that helps you generate code and perform various tasks in your Laravel application. It leverages the power of OpenAI's GPT language model to provide an interactive and intelligent development experience.

Demo
----

[](#demo)

### Architect -&gt; create a todo app 😎🏗️📝

[](#architect---create-a-todo-app-️)

    B.mp4    ### Attach files and create a readme.md 📎📄✍️

[](#attach-files-and-create-a-readmemd-️)

    B2.mp4    Installation
------------

[](#installation)

1. Install the Synth package using Composer:

    ```
    composer require blinq/synth
    ```
2. Publish the Synth configuration file:

    ```
    php artisan vendor:publish --tag=synth-config
    ```

    Here you can change the used model (gpt4 versus gpt3)
3. Set your OpenAI API key in the `.env` file:

    `  OPENAI_KEY=YOUR_API_KEY  `

Usage
-----

[](#usage)

To use Synth, simply run the `synth` command:

```
php artisan synth
```

This will open the Synth CLI, where you can interact with the GPT model and perform various tasks.

### Features 🌟

[](#features-)

- Automatically switch from small to large model when needed (gpt-3.5-turbo vs gpt-3.5-turbo-16k) 🔄
- Include the whole database schema as an attachment
- Uses the functions API of OpenAI 👨‍💻
- Cancel generation with Ctrl+C 🚫⌨
- Attachments: Attach files to the conversation with GPT. 🗂️
- Architect: Brainstorm and generate a new application architecture. 💡🏛
- Chat: Chat with GPT to get responses and perform actions. 💬
- Make: Forces GPT to generate files for the question asked. 📂
- Migrations: Generate migrations for your application. 📦
- Models: Generate models for your application. 📈
- Files: Write files to the filesystem. 🖊️

You can select a module from the main menu and follow the prompts to perform the desired actions.

> Note: Some modules require a previous step to be completed, such as creating an architecture before generating migrations or models.

Writing Your Own Modules
------------------------

[](#writing-your-own-modules)

Synth allows you to extend its functionality by writing your own modules. A module is a class that implements the necessary methods to register and handle specific actions.

To create a new module, follow these steps:

1. Create a new PHP class that extends the `Module` class.
2. Implement the `name` method to define the name of your module.
3. Implement the `register` method to define the actions provided by your module.
4. Implement the `onSelect` method to handle the selected action.

Here is an example of a custom module implementation:

```
use Blinq\Synth\Modules\Module;

/**
 * Class MyModule
 *
 * @propery \Blinq\Synth\Commands\SynthCommand $cmd
 */
class MyModule extends Module
{
    public function name(): string
    {
        return 'MyModule';
    }

    public function register(): array
    {
        return [
            'action1' => 'Perform Action 1',
            'action2' => 'Perform Action 2',
        ];
    }

    public function onSelect(?string $key = null)
    {
        $this->cmd->info("You selected: {$key}");

        $synth = $this->cmd->synth;

        if ($key === 'action1') {
            // Handle Action 1
            while (true) {
                $input = $this->cmd->ask("You");

                // Send the input to GPT
                $synth->chat($input, [
                    // ... The OpenAI Chat options

                    // If you want a function to be called by GPT
                    'function_call' => ['name' => 'some_function'], // Forces the function call
                    'functions' => [
                        [
                            'name' => 'some_function',
                            'description' => 'Description of the function',
                            'parameters' => [
                                // ..schema
                            ]
                        ]
                    ]
                ]);

                Functions::register('some_function', function (SynthCommand $cmd, $args, $asSpecified, $inSchema) { // etc..
                    // Do something with the call
                });

                // This will parse the json result and call the function if needed
                $synth->handleFunctionsForLastMessage();

                // Just retrieve the last message
                $lastMessage = $synth->getLastMessage();

                // Echo it's contents
                echo $lastMessage->content;

                // Or it's raw function_call
                dump($lastMessage->function_call);

                if (!$input || $input == 'exit') {
                    break;
                }
            }
        }
        if ($key === 'action2') {
            // Handle Action 2
        }
    }
}
```

You can then register your custom module in the `Modules` class within the Synth package and use it in the CLI interface:

```
use Blinq\Synth\Modules;

Modules::register(MyModule::class);
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.2% 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 ~3 days

Total

8

Last Release

1040d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1346240?v=4)[Blinq](/maintainers/Blinq)[@Blinq](https://github.com/Blinq)

---

Top Contributors

[![lennardv2](https://avatars.githubusercontent.com/u/168357?v=4)](https://github.com/lennardv2 "lennardv2 (47 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")[![hofmannsven](https://avatars.githubusercontent.com/u/1214387?v=4)](https://github.com/hofmannsven "hofmannsven (1 commits)")

---

Tags

chatgptlaravelopenaiphplaravelsynthblinq

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/blinq-synth/health.svg)

```
[![Health](https://phpackages.com/badges/blinq-synth/health.svg)](https://phpackages.com/packages/blinq-synth)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[marcelweidum/filament-expiration-notice

Customize the livewire expiration notice

9169.0k4](/packages/marcelweidum-filament-expiration-notice)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

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