0

I am creating a Laravel package where I need to have some forked packages as required. for example, I am creating a package named rifRocket/laravel-lbs and I forked a package named spatie/laravel-permission as rifRocket/laravel-permission, when I add this repository in my package's composer.json and I install my created package in any laravel project then project's composer through an error "Your requirements could not be resolved to an installable set of packages."

my package's composer file:

{
    "name": "rifrocket/laravel-lbs",
    "description": "description",
    "keywords": [
        "rifrocket",
        "laravelcmsbase"
    ],
    "homepage": "https://github.com/rifrocket/laravel-lbs",
    "license": "MIT",
    "type": "library",
    "authors": [
        {
            "name": "name",
            "email": "email@gmail.com",
            "role": "Developer"
        }
    ],
    "repositories": [{
        "type": "path",
        "url": "https://github.com/rifRocket/laravel-permission"
    }
    ],
    "require": {
        "php": "^7.1",
        "livewire/livewire": "^2.3.1",
        "intervention/image": "^2.5",
        "spatie/laravel-permission": "dev-rifRocket-patch-lbs"
    },

    "require-dev": {
        "orchestra/testbench": "^4.0",
        "phpunit/phpunit": "^8.0"
    },
    "minimum-stability": "dev",

    "autoload": {
        "psr-4": {
            "RifRocket\\LaravelCmsBase\\": "src"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "RifRocket\\LaravelCmsBase\\Tests\\": "tests"
        }
    },
    "scripts": {
        "test": "vendor/bin/phpunit",
        "test-coverage": "vendor/bin/phpunit --coverage-html coverage"

    },
    "config": {
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "providers": [
                "RifRocket\\LaravelCmsBase\\Providers\\LaravelCmsBaseServiceProvider"
            ],
            "aliases": {
                "LaravelCmsBase": "RifRocket\\LaravelCmsBase\\Facades\\LaravelCmsBaseFacade"

            }
        }
    }
}
  • You have to add it in the `repositories` key. Have a look here https://stackoverflow.com/questions/13498519/how-to-require-a-fork-with-composer – ml59 Nov 10 '20 at 10:27
  • i already pass the key – Rif Rocket Nov 10 '20 at 10:34
  • when i use the same repository code in laravel's composer.json file it's working fine but when I try to add same code in my package and install my package in laravel project then it's not working (i.e not installing my repository package) – Rif Rocket Nov 10 '20 at 10:36
  • Can you share the **full and exact** error message? – Nico Haase Nov 10 '20 at 10:40
  • Your requirements could not be resolved to an installable set of packages. Problem 1 - rifrocket/laravelcmsbase dev-master requires spatie/laravel-permission dev-rifRocket-patch-lbs -> no matching package found. - rifrocket/laravelcmsbase dev-master requires spatie/laravel-permission dev-rifRocket-patch-lbs -> no matching package found. - Installation request for rifrocket/laravelcmsbase dev-master -> satisfiable by rifrocket/laravelcmsbase[dev-master]. – Rif Rocket Nov 10 '20 at 10:42
  • @RifRocket try with `"type":"vcs"` instead of `"type": "path"` – ml59 Nov 10 '20 at 10:44
  • i tried with type:vcs, type: composer, type: git, but it's not working at all – Rif Rocket Nov 10 '20 at 10:47

0 Answers0