#development #laravel #php #tools

If you want to use a forked package in Laravel, here are the steps you need to follow:

  1. Create a fork of the package on GitHub.

  2. Create a new branch in the fork which will contain your changes.

  3. Make the necessary changes to the package in the new branch.

  4. Push the changes to the fork.

  5. Update the composer.json file in your Laravel project to point to the forked package.

     1{
     2    "require": {
     3        "<original-owner>/<package-name>": "dev-<branchname>",
     4    },
     5    "repositories": [
     6        {
     7        "type": "vcs",
     8        "url": "https://github.com/<fork-owner>/<package-name>"
     9        }
    10    ]
    11}
    12
    
  6. Run composer update to install the forked package.

If you didn't have the package installed yet, you can tell composer to install a specific version:

composer require <original-owner>/<package-name>:dev-<branchname>

Based on the instructions found here and here.