api-ecosystem-for-laravel / dingo-api

Replacement repo for dingo/api
BSD 3-Clause "New" or "Revised" License
265 stars 58 forks source link

Add Laravel 9 support #18

Closed christoph-kluge closed 2 years ago

christoph-kluge commented 2 years ago

Description

In general tests look good for L9 + PHP8+ but changes are not backward compatible

Waiting for dependent packages

Tests overview

Install instructions

Test and install this locally first. Thanks to @tobias-kuendig for sharing the instructions.

composer.json:

    "repositories": [
        {
            "type": "vcs",
            "url":  "https://github.com/christoph-kluge/dingo-api"
        },
        {
            "type": "vcs",
            "url":  "https://github.com/dmason30/blueprint"
        }
    ],

Then require the package like so:

composer require api-ecosystem-for-laravel/dingo-api dev-laravel-9-support
christoph-kluge commented 2 years ago

Missing php 8.1 support using dev version for now https://github.com/thephpleague/fractal/issues/526

christoph-kluge commented 2 years ago

This addresses #15 #16 #17

suguer commented 2 years ago

now laravel9 illuminate/routing version is 9.0 but dingo-api just require ^7.0|^8.0 how can i fix it

christoph-kluge commented 2 years ago

@suguer without further details it's hard to tell. My first quess: You're using the wrong version and/or fork.

Did you add my fork as repository to your composer.json?

https://getcomposer.org/doc/05-repositories.md

suguer commented 2 years ago

@christoph-kluge Did you add my fork as repository to your composer.json? no , I do not change my composer.json anything

this is my full command output

Using version ^3.1 for api-ecosystem-for-laravel/dingo-api ./composer.json has been updated Running composer update api-ecosystem-for-laravel/dingo-api Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.

Problem 1

You can also try re-running composer require with an explicit version constraint, e.g. "composer require api-ecosystem-for-laravel/dingo-api:*" to figure out if any version is installable, or "composer require api-ecosystem-for-laravel/dingo-api:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

christoph-kluge commented 2 years ago

I see. So without changing your composer you'll be not able to test my fork. This pull-request is just a proposal to this library and does not necessarily mean that the maintainers will merge it.

If you want to test my non-official fork then you should to explicitly define this in your composer.json.

https://getcomposer.org/doc/05-repositories.md#loading-a-package-from-a-vcs-repository

suguer commented 2 years ago

ok. take the liberty to ask .what parameters should I write to composer.json . I don't know how to write composer.json very well thx very much

suguer commented 2 years ago

@christoph-kluge excuse me , can you teach me how to write to composer.json . I try it, but failure

christoph-kluge commented 2 years ago

@suguer please check out the last link to the composer documentation how to load a package from vcs. You need my fork's github-url and the branch name. You can find this information on top of this page right below the title of the PR and replace the values in these examples.

If you click on my source branch you'll get redirected to my fork's URL and the branch. https://github.com/christoph-kluge/dingo-api and laravel-9-support. It's important to prefix dev-{branchname} as mentioned in the documentation.

suguer commented 2 years ago

okk, my composer.json is right , but still failed

when i run "composer update"

Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.

Problem 1

Endy-c commented 2 years ago

When could this pull request be merged?

tobias-kuendig commented 2 years ago

For anyone trying to get @christoph-kluge's PR working locally before it being merged, you need to add these to your composer.json:

    "repositories": [
        {
            "type": "vcs",
            "url":  "git@github.com:christoph-kluge/dingo-api.git"
        },
        {
            "type": "vcs",
            "url":  "git@github.com:dmason30/blueprint.git"
        },
        {
            "type": "vcs",
            "url": "https://github.com/annuh/fractal.git"
        }
    ],

Then require the package like so:

composer require api-ecosystem-for-laravel/dingo-api dev-laravel-9-support
Endy-c commented 2 years ago

For anyone trying to get @christoph-kluge's PR working locally before it being merged, you need to add these to your composer.json:

    "repositories": [
        {
            "type": "vcs",
            "url":  "git@github.com:christoph-kluge/dingo-api.git"
        },
        {
            "type": "vcs",
            "url":  "git@github.com:dmason30/blueprint.git"
        },
        {
            "type": "vcs",
            "url": "https://github.com/annuh/fractal.git"
        }
    ],

Then require the package like so:

composer require api-ecosystem-for-laravel/dingo-api dev-laravel-9-support

solved! extremely grateful!

christoph-kluge commented 2 years ago

@tobias-kuendig thank you for adding this here.

I did change the repository-urls from git@ to https:// and added your install instructions to the MR description.

tdavidsonas88 commented 2 years ago

composer update passed without errors for me with this guide. Nice! :tada: The downside that on my project all requests I have gives me 500 Internal Server Error without any backtrace message now. So gonna debug it.

shoosah commented 2 years ago

Any idea when does this PR could be merged?

xtieume commented 2 years ago

Not working with Fractal

prady00 commented 2 years ago

When are we merging this PR?

minkbear commented 2 years ago

Waiting this as well

specialtactics commented 2 years ago

Hey all, sorry for the wait - I've been absent due to first holiday in 3.5 years, you know how it is :cry:

Now that this is in a group though, I am able to and would be happy to give access to people who are committed and able to help maintain this package - please let me know if you are interested!

specialtactics commented 2 years ago

Just some updates for versions, https://github.com/api-ecosystem-for-laravel/dingo-api/pull/22

Please use tag v4.0.0 to get all the latest changes for laravel 9

christoph-kluge commented 2 years ago

@specialtactics I would be interested. Would you be up for a chat regarding short/mid/long-term plans for this lib? Can I reach you in some slack/discord channel?

Back in the days laravel was missing a lot of api-related features. Since then a lot changed and we might reduce a bit of boilerplate within this package.

specialtactics commented 2 years ago

Yes @christoph-kluge I agree, are you on the main laravel slack by any chance?