Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Snapey's avatar
Level 122

Composer local repository in order to work on a package

I'm attempting to create a PR for Laravel/Fortify, but I'm not sure how to create the correct local environment in order to evaluate the code changes.

Steps so far;

1, Fork Fortify to my own Github account

2, git clone the fork into a fortify folder on my local machine

3, create a new laravel project in a folder parallel to the fortify package

4, change the laravel composer.json to add local repository

        "repositories": [
        {
            "type": "path",
            "url": "../fortify"
        }
    ]

5, require the dev-master version of fortify

    "require": {
        "php": "^7.3",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^8.0",
        "laravel/jetstream": "^1.1",
        "laravel/sanctum": "^2.6",
        "laravel/tinker": "^2.0",
        "livewire/livewire": "^2.0",
        "laravel/fortify": "dev-master"
    },

6, run composer upgrade.

The problem I get is that Jetstream also requires Fortify at a specific branch.

Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/jetstream v1.1.2 requires laravel/fortify ^1.0 -> satisfiable by laravel/fortify[1.x-dev].
    - laravel/jetstream 1.x-dev requires laravel/fortify ^1.0 -> satisfiable by laravel/fortify[1.x-dev].
    - laravel/jetstream v1.1.0 requires laravel/fortify ^1.0 -> satisfiable by laravel/fortify[1.x-dev].
    - laravel/jetstream v1.1.1 requires laravel/fortify ^1.0 -> satisfiable by laravel/fortify[1.x-dev].
    - laravel/jetstream v1.1.2 requires laravel/fortify ^1.0 -> satisfiable by laravel/fortify[1.x-dev].
    - Can only install one of: laravel/fortify[dev-master, 1.x-dev].
    - Can only install one of: laravel/fortify[dev-master, 1.x-dev].
    - Installation request for laravel/fortify dev-master -> satisfiable by laravel/fortify[dev-master].
    - Installation request for laravel/jetstream ^1.1 -> satisfiable by laravel/jetstream[1.x-dev, v1.1.0, v1.1.1, v1.1.2].

I thought perhaps I have to also create a local repository for Jetstream and change that to also require dev-master but I can't get that to work either

0 likes
3 replies
thewebartisan7's avatar
Level 14

Try change to:

"laravel/fortify": "@dev"

When prefer-stable is true in your project's composer.json, Composer will get the package from packagist and install it, he will not care about your local package, in spite of the fact that there is a repository with a path declared in your composer.json.

And in repository I would try with options symlink altought it may not be required:

"repositories": {
        "laravel/fortify": {
            "type": "path",
            "url": "../fortify",
            "options": {
                "symlink": true
            }
        }
    }

See https://getcomposer.org/doc/05-repositories.md#path

Please or to participate in this conversation.