Search by

tobya / work-with-composer

tobya

Work-with-composer provides a basic set of tools for working with local repositories

Package info

github.com/tobya/work-with-composer

pkg:composer/tobya/work-with-composer

Fund package maintenance!

Tobya

Statistics

Installs: 51

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

0.8.4 2026-09-29 07:40 UTC

This package is auto-updated.

Last update: 2026-09-29 07:41:34 UTC


README

Latest Version on Packagist Total Downloads

A set of simple tools to allow easy swapping in of local and production repositories. This is very useful when you are working on a package in conjunction with an app. Previously created local links are stored so that future application can be simply selected.

Installation

You can install the package via composer:

composer require tobya/work-with-composer

You can publish the config file with:

php artisan vendor:publish --tag="work-with-composer-config"

Ideally .gitignore your work-with-composer.json file, as this will be different on each dev machine.

# .gitignore
work-with-composer.json

Usage

Add a new local repository

$ php artisan wwcomposer:add-local

  Package Name eg. tobya/QueueStatus:
❯ tobya/queuestatus

  Full Local Directory Path:
❯ C:\Development\github\queuestatus

All done - Local Repo for tobya/queuestatus has been created.
Don't forget to composer require your package
Composer require tobya/queuestatus

 Do you wish to run it now? (yes/no) [no]:
 > yes

./composer.json has been updated
Running composer update tobya/queuestatus
Loading composer repositories with package information

Restore a repository to the production version before publishing your app.

 php artisan wwcomposer:restore-production

 Which repository do you want to restore?:
  [0] tobya/work-with-composer
  [1] tobya/bcsapiwrapper
  [2] tobya/queuestatus
 > 2
2

Repository restored: tobya/queuestatus dev-main
Don't forget to composer require your package
Composer require tobya/queuestatus

 Do you wish to run composer require now? (yes/no) [no]:
 > 

Restore a previously set up local repository for development

php artisan wwcomposer:restore-local

 Which repository do you want to restore?:
  [0] tobya/work-with-composer
  [1] tobya/bcsapiwrapper
  [2] tobya/queuestatus
 > 0
0

All done - Local Repo for tobya/work-with-composer has been created.
Don't forget to composer require your package
Composer require tobya/work-with-composer

 Do you wish to run it now? (yes/no) [no]:
 > yes

List all Local Repositories

php artisan wwcomposer:list-local

Composer Errors

Sometimes things get out of whak and you will get an error from composer saying everyign is skew ways. Thsi can usually be fixed very easily with composer update

Notes

Work with Composer modifies your composer.json file. It does this by reading, modifiying and writing the file. Unfortunately this does not preserve with space etc. If you do not like something messing with your composer.json file you probably shouldnt use this package.

The package stores the version of a package that was set when the local version is provided. When restored this 'last_known_version' is restored.

Testing

composer test

Credits

License

The MIT License (MIT). Please see License File for more information.