-
Notifications
You must be signed in to change notification settings - Fork 43
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
Can't explain this issue, 500 status code with response 1 #158
Comments
On further debugging i managed to discover the following:
<?php
namespace App\JsonApi\V1\Users;
use App\Models\User;
use LaravelJsonApi\Eloquent\Contracts\Paginator;
use LaravelJsonApi\Eloquent\Fields\DateTime;
use LaravelJsonApi\Eloquent\Fields\ID;
use LaravelJsonApi\Eloquent\Filters\WhereIdIn;
use LaravelJsonApi\Eloquent\Pagination\PagePagination;
use LaravelJsonApi\Eloquent\Schema;
class UserSchema extends Schema
{
/**
* The model the schema corresponds to.
*
* @var string
*/
public static string $model = User::class;
/**
* Get the resource fields.
*
* @return array
*/
public function fields(): array
{
return [
ID::make(),
];
}
/**
* Get the resource filters.
*
* @return array
*/
public function filters(): array
{
return [
WhereIdIn::make($this),
];
}
/**
* Get the resource paginator.
*
* @return Paginator|null
*/
public function pagination(): ?Paginator
{
return PagePagination::make();
}
} |
forgot to mention i downgraded to 8.0 |
I'm not sure that you did because
can only happen on PHP 8.1 as readonly is a reserved keyword only on PHP 8.1 due to the read only feature Or maybe you now have a different error? |
@X-Coder264 😅 sail didn't downgrade it properly ... i'll try to fix it now. but if it works for everybody else that is the issue :) thank you very much and sorry for stealing precious time from ya closing. |
hi there :)
i am trying to set up this package and follow the tutorial on the docs.
i am running in a strange issue when i register the route
I followed every step in the tutorial and just did a resource (User instead of Post) to play around.
If I don't register the route i get the correct response:
If i register the route it stops working. Giving an error 500 and no response (Postman shows 1)
Running on PHP 8.1.0 and the following are my composer dependencies:
How can I even debug this? Could it be a Sail issue?
Thanks
The text was updated successfully, but these errors were encountered: