-
Notifications
You must be signed in to change notification settings - Fork 108
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
Lumen support #61
Comments
Would love to add this, but it hasn't been a priority because we don't have any Lumen apps. I haven't actually used Lumen before so don't know what the differences are in terms of wiring it all up. Is this something you'd be willing to help with? |
I've started to dig into a little bit. Trying to write a proof of concept for Lumen 5.4. It's not working yet but also I didn't faced any show-stopper yet. What I've figured out so far:
That is how far I got yet. Hopefully I've a little spare time the next weeks to investigate it further. I'm having a simple lumen app consuming my lumen branch of laravel-json-api to test with. Could push that one also to GitHub if you or someone else also like to work on these issue. |
Hey. This sounds good - thanks so much for putting the time into it. I'll need to look into this in a bit more detail, but here's some initial thoughts... I think The routing is the thing that I thought would be the most difficult, considering that Lumen does it completely differently. The regular expression isn't massively important, but the defaults are being used to push the relationship name and the resource type into the route so that the package can detect these values as things happen through the middleware. I'll have to dig around in the Lumen code a bit. If we can't push these in to the routing, then one solution that springs to mind is to provide them to the In terms of a simple Lumen app, that sounds great. There's currently a |
Thanks for your fast response and thanks for pointing out what injecting defaults in a route is used for. 👍 I think I found a quick work-a-round to move forward. jelhan@9200b17 What I've done so far was just meant as a proof of concept. Just a quick write to find possible show-stoppers and have an idea what need to be done. Just wanna prove before that it would work and that it won't be a waste of time before starting refactor laravel-json-api, adding tests etc. Pushing my sample app in it's current stage is absolutely fine for my. |
Moved forward and faced an issue I wasn't able to resolve yet. |
It's used to generate paging links, so is injected into the Also anything that uses the I'm surprised there isn't one in Lumen - how in Lumen do you create a link to a named route? |
Ah yeah, of course. Guess I'm already in weekend mode. Sorry for disturbing you, it's just A first, very simple request is passing now! Maybe a good point to go into the weekend. 😎 |
@jelhan is your version working well with Lumen then? |
Sorry for late update. Haven't had the time to push that one further. Faced more and more lumen limitations in my application I want to use laravel-json-api and decided therefore to migrate to Laravel. I have pushed my latest attempts to https://github.com/jelhan/laravel-json-api/tree/lumen and https://github.com/jelhan/demo-lumen-json-api. Currently only fetching a list of posts is working and it relies on some dirty work-a-rounds. There are two main issues I have faced and have not treated so far. There may be more which does not came to table yet since I did not tried creating or updating a model at all.
|
@jelhan thanks for the update. For (1) I'm planning some improvements to the middleware and route parameter stuff. At the moment my current thinking is to remove the default parameters and instead push the resource type and relationship names via middleware parameters. That'll solve the issue in Lumen I think and if I make the JSON API registrar only use methods that are on both the Laravel and Lumen routers, the two should be cross compatible. I don't know how feasible it is considering that I don't use Lumen but hopefully it'll help. |
@lindyhopchris I'm going to be working with @jelhan's repo for now and will try to work out any kinks and share what I find here. Hope it can all make it back into this base package as it would be nice to have something that works well in both Laravel and Lumen. Will keep you posted. |
Status update? |
@KevMT still want to add this but haven't had time to do it yet... it's not helped by us not having any Lumen projects at the moment. Can look at it once we get to |
@lindyhopchris Thanks man.. really looking forward. |
@lindyhopchris when the release of this functionality? |
@Vendin still want to put this in but unfortunately I don't have any projects at the moment that are Lumen - I'm only doing Laravel work at the mo. So that means I still haven't had time to look at Lumen support. Still intending to put it in though, after the |
@lindyhopchris Hi man, I hope this will help a bit, https://gist.github.com/kevyworks/9ef3e50d01584ecf6e682266c51971f2 There are lots to do "maybe" but for now it simply works, with laravel's standard Resource class. |
I'm actually looking for a good lumen package for a project at work and will try this one (https://github.com/swisnl/json-api-client) at first, if I find some time I'll take a look at your repo compare it to the other one and eventually do a merge request |
@j3rrey yeah, that one is for retrieving resources from a JSON API server... looks good, will have to give it a go at some point. This package is the server-side, not the client side. I.e. it processes inbound JSON API requests. So the two packages might be quite different, though it would be nice to see if there's any places we could converge. My plan with |
The design for 2.0 in theory means that using this in a Lumen app will be more than possible. See #411 |
Is there any plan to add support for lumen? I tried out with lumen 5.4 but it seem to break php artisan in similar way as described in laravel/lumen-framework#504.
The text was updated successfully, but these errors were encountered: