Weave 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

Interop Config Laravel Package

sandrokeil/interop-config

Framework-agnostic PHP library for configuration-driven factories. Validates config structure, merges defaults, enforces required options, reduces factory boilerplate, supports auto-discovery of factories, and can generate configuration files from factory classes.

View on GitHub
Deep Wiki
Context7

Console Tools

Starting in 2.1.0, interop-config began shipping with console tools.

To get an overview of available commands run in your CLI ./vendor/bin/interop-config help. This displays the following help message.

Usage:
  command [options] [arguments]

Options:
  -h, --help, help          Display this help message

Available commands:
  generate-config           Generates options for the provided class name
  display-config            Displays current options for the provided class name

generate-config

The generate-config command is pretty handy. It has never been so easy to create the configuration for a class which uses one of the Interop\Config interfaces. Depending on implemented interfaces, a wizard will ask you for the option values. It is also possible to update your current configuration. The value in brackets is used, if input is blank.

Usage:
  generate-config  [options] [<configFile>] [<className>]

Options:
  -h, --help, help       Display this help message

Arguments:
  configFile             Path to a config file or php://stdout for which to generate options.
  className              Name of the class to reflect and for which to generate options.

Reads the provided configuration file (creating it if it does not exist), and injects it with options for the provided 
class name, writing the changes back to the file.

If your PHP config file is in the folder config/global.php and you have a class My\AwesomeFactory then you run

$ ./vendor/bin/interop-config generate-config config/global.php "My\AwesomeFactory"

display-config

You can also see which options are set in the configuration file for a factory. If multiple configurations are supported through the Interop\Config\RequiresConfigId you can enter a config id or leave it blank to display all configurations.

Usage:
  display-config  [options] [<configFile>] [<className>]
  
Options:
  -h, --help, help       Display this help message

Arguments:
  configFile             Path to a config file for which to display options. It must return an array / ArrayObject.
  className              Name of the class to reflect and for which to display options.

Reads the provided configuration file and displays options for the provided class name.

If your PHP config file is in the folder config/global.php and you have a class My\AwesomeFactory then you run

$ ./vendor/bin/interop-config display-config config/global.php "My\AwesomeFactory"
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.
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo
stevenay/myanfont
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin