Skip to content

Add Laravel 9 support #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

christoph-kluge
Copy link
Contributor

@christoph-kluge christoph-kluge commented Feb 10, 2022

Description

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

Waiting for dependent packages

Tests overview

  • ❌ Laravel 8 + PHP 7.4.15 (fail due to php incompatible function calls)
  • ❌ Laravel 8 + PHP 8.0.15 (2 tests break because of mismatching type - symfonys repsonse getContent() changed return behavior)
  • ❌ Laravel 8 + PHP 8.1.2 (fail due to php incompatible function calls)
  • ✅ Laravel 9 + PHP 8.0.15
  • ✅ Laravel 9 + PHP 8.1.2

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
Copy link
Contributor Author

Missing php 8.1 support using dev version for now thephpleague/fractal#526

@christoph-kluge christoph-kluge marked this pull request as ready for review February 11, 2022 08:38
@christoph-kluge
Copy link
Contributor Author

This addresses #15 #16 #17

…->noContent() was breaking due to "null" values for getContent(). The proper fix seems to ensure we always have an empty "string"
@suguer
Copy link

suguer commented Feb 14, 2022

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

@christoph-kluge
Copy link
Contributor Author

@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
Copy link

suguer commented Feb 14, 2022

@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
- Root composer.json requires api-ecosystem-for-laravel/dingo-api ^3.1 -> satisfiable by api-ecosystem-for-laravel/dingo-api[v3.1.0, v3.1.1].
- api-ecosystem-for-laravel/dingo-api[v3.1.0, ..., v3.1.1] require illuminate/routing ^7.0|^8.0 -> found illuminate/routing[v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but it conflicts with your root composer.json require (^9.0).

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
Copy link
Contributor Author

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
Copy link

suguer commented Feb 14, 2022

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
Copy link

suguer commented Feb 16, 2022

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

@christoph-kluge
Copy link
Contributor Author

@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
Copy link

suguer commented Feb 17, 2022

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
- Root composer.json requires api-ecosystem-for-laravel/dingo-api dev-laravel-9-support -> satisfiable by api-ecosystem-for-laravel/dingo-api[dev-laravel-9-support].
- api-ecosystem-for-laravel/dingo-api dev-laravel-9-support requires dingo/blueprint dev-patch-1 -> found dingo/blueprint[dev-chore/laravel-7-compat, dev-master, v0.1.0, ..., v0.4.3] but it does not match the constraint.

@Endy-c
Copy link
Contributor

Endy-c commented Feb 21, 2022

When could this pull request be merged?

@tobias-kuendig
Copy link

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":  "[email protected]:christoph-kluge/dingo-api.git"
        },
        {
            "type": "vcs",
            "url":  "[email protected]: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
Copy link
Contributor

Endy-c commented Feb 21, 2022

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":  "[email protected]:christoph-kluge/dingo-api.git"
        },
        {
            "type": "vcs",
            "url":  "[email protected]: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
Copy link
Contributor Author

@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
Copy link

composer update passed without errors for me with this guide. Nice! 🎉 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
Copy link

shoosah commented Jun 1, 2022

Any idea when does this PR could be merged?

@xtieume
Copy link

xtieume commented Jun 19, 2022

Not working with Fractal

@prady00
Copy link

prady00 commented Jul 26, 2022

When are we merging this PR?

@minkbear
Copy link

minkbear commented Aug 8, 2022

Waiting this as well

@specialtactics specialtactics merged commit 8ca5a1e into api-ecosystem-for-laravel:master Aug 20, 2022
@specialtactics
Copy link
Contributor

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

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
Copy link
Contributor

Just some updates for versions, #22

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

@christoph-kluge
Copy link
Contributor Author

@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
Copy link
Contributor

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

@Yoruchiaki Yoruchiaki mentioned this pull request Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants