Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phinx Bundle Laravel Package

diablomedia/phinx-bundle

View on GitHub
Deep Wiki
Context7

Composer

The fastest way to install Phinx bundle is to add it to your project using Composer (http://getcomposer.org/).

  1. Install Composer:

    curl -sS https://getcomposer.org/installer | php
    
  2. Require Phinx bundle as a dependency using Composer:

    php composer.phar require diablomedia/phinx-bundle
    
  3. Install bundle:

    php composer.phar install
    
  4. Add bundle to config/bundles.php

    return [
        // [...]
        DiabloMedia\PhinxBundle\DiabloMediaPhinxBundle::class => ['all' => true],
    ];
    
  5. Add bundle config to config/packages/diablo_media_phinx.yaml

    Minimal example:

    diablo_media_phinx:
        environment:
            connection:
                dsn: 'mysql://db_user:[email protected]:3306/db_name'
    

Configuration

The bundle can be installed and Symfony's cache can be built without any configuration. A database connection is required before running commands that access the database.

Option Type / default Description
migration_base_class class-string; Phinx's AbstractMigration Base class used by newly generated migrations. The class must extend Phinx's AbstractMigration.
adapters map; empty Registers custom Phinx database adapters. Each key is the adapter name used by a DSN and each value is a class implementing Phinx's AdapterInterface.
paths.migrations string, list, or namespace map; %kernel.project_dir%/src/Resources/db/migrations Location or locations scanned for migrations. A keyed map associates migration namespaces with paths. Glob patterns are supported by Phinx.
paths.seeds string, list, or namespace map; %kernel.project_dir%/src/Resources/db/seeds Location or locations scanned for seed classes. A keyed map associates seed namespaces with paths.
environment.connection.dsn string; required when connection is configured Database-agnostic connection URL in the form <adapter>://[<user>[:<password>]@]<host>[:<port>]/<database>[?<options>]. Common adapters are mysql, pgsql, sqlite, and sqlsrv.
environment.migration_table string; phinxlog Table used by Phinx to record which migrations have run. Schema-qualified names such as phinx.log are supported by databases such as PostgreSQL.
environment.table_prefix string; none Prefix Phinx applies to table names handled through its adapter.
environment.table_suffix string; none Suffix Phinx applies to table names handled through its adapter.
environment.prompt_password boolean; false Prompts for the database password using a hidden Symfony Console question before database-dependent commands run. Create commands do not prompt.

For example:

diablo_media_phinx:
    migration_base_class: App\Migration\AbstractMigration

    paths:
        migrations:
            App\Migrations: '%kernel.project_dir%/migrations'
        seeds:
            App\Seeds: '%kernel.project_dir%/seeds'

    adapters:
        custom: App\Database\CustomPhinxAdapter

    environment:
        migration_table: phinx_migrations
        table_prefix: app_
        connection:
            dsn: 'mysql://db_user:[email protected]:3306/db_name?charset=utf8mb4'

The bundle exposes a single Phinx environment named default; Symfony configuration determines its connection and paths. See the Phinx configuration reference for more detail about DSNs, migration paths, adapters, and migration behavior.

Interactive database password

To keep the database password out of configuration and environment variables, omit it from the DSN and enable the password prompt:

diablo_media_phinx:
    environment:
        prompt_password: true
        connection:
            dsn: 'mysql://[email protected]:3306/db_name'

Database-dependent commands will ask for the password without displaying it:

Password for [email protected]:

Commands run with --no-interaction cannot prompt and will stop with an explanatory error. For CI and automated deployments, use a separate Symfony configuration that supplies a complete DSN and leaves prompt_password disabled.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
gsferro/filament-odometer-easy
gsferro/filament-stat-plus-easy
jeffersongoncalves/filament-barcode-field
martin6363/filament-sidebar-resize
graystackit/laravel-dymo-printer
phpinnacle/money
lastdragon-ru/lara-asp-documentator
tumutech/laravel-qr-code
babenkoivan/elastic-scout-driver-plus
socialiteproviders/apple
phpshko/laravel-livewire-depdrop
larasell-dev/larasell
calliostro/spotify-bundle
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle