GithubHelp home page GithubHelp logo

Comments (7)

jasonlewis avatar jasonlewis commented on August 15, 2024

I believe I pushed a fix for this. You can set the resource key as the last
parameter to withCollection.
On 30 Jun 2014 13:09, "bpudenz" [email protected] wrote:

I'm getting "The $resourceKey parameter must be provided when using
League\Fractal\Serializer\JsonApiSerializer" when combining this with a
cursor:

$cursor = new Cursor($currentCursorStr, $newCursorStr, $users->count());

return Response::api()->withCollection($users, new UserTransformer,
$cursor);

I see resourceKey in the serializer docs.. is this currently incompatible
with dingo/api?


Reply to this email directly or view it on GitHub
#80.

from fractal.

bpudenz avatar bpudenz commented on August 15, 2024

return Response::api()->withCollection($users, new UserTransformer, $cursor, 'users');

Gives me the same result. In the Fractal docs, the third parameter is $resourceKey, in the Api, it's a cursor = null.

from fractal.

jasonlewis avatar jasonlewis commented on August 15, 2024

Try updating to the latest 0.7.* version of the API if you haven't already.
I just looked, it definitely had the resource key as the fourth parameter
which is then used as the third parameter when creating a new collection
resource.
On 30 Jun 2014 13:30, "bpudenz" [email protected] wrote:

return Response::api()->withCollection($users, new UserTransformer,
$cursor, 'users');

Gives me the same result. In the Fractal docs, the third parameter is
$resourceKey, in the Api, it's a cursor = null.


Reply to this email directly or view it on GitHub
#80 (comment).

from fractal.

bpudenz avatar bpudenz commented on August 15, 2024

Checking versions does the job. It looks like that fixes it when I move the Route outside the 'protected' => true group, but when I leave it in and pass a valid access_token, I get:

call_user_func() expects parameter 1 to be a valid callback, no array or string given

I wasn't getting this before. Did something else change between 0.6.* and 0.7.* that would cause this? I'm simply pointing to:

Route::api(['version' => 'v1', 'protected' => true], function()
{
Route::get('user', 'UserController@index')
}];

from fractal.

jasonlewis avatar jasonlewis commented on August 15, 2024

Yeah check the issues on the API package, also check
https://github.com/dingo/api/wiki/Changes regularly.
On 30 Jun 2014 14:00, "bpudenz" [email protected] wrote:

Checking versions does the job. It looks like that fixes it when I move
the Route outside the 'protected' => true group, but when I leave it in and
pass a valid access_token, I get:

call_user_func() expects parameter 1 to be a valid callback, no array or
string given

I wasn't getting this before. Did something else change between 0.6.* and
0.7.* that would cause this? I'm simply pointing to:

Route::api(['version' => 'v1', 'protected' => true], function()
{
Route::get('user', 'UserController@index')
}];


Reply to this email directly or view it on GitHub
#80 (comment).

from fractal.

bpudenz avatar bpudenz commented on August 15, 2024

thanks

from fractal.

philsturgeon avatar philsturgeon commented on August 15, 2024

Looks like you guys have this one figured out, and its not directly a Fractal thing anyhow. :)

from fractal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.