You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've only recently started using this package and I think there's an issue with the LaravelJsonApi\Eloquent\Contracts\ReadOnly interface and LaravelJsonApi\Eloquent\Fields\Concerns\ReadOnly trait in PHP 8.1 due to readonly properties that were added: https://php.watch/versions/8.1/readonly:
I followed the tutorial and when I try to clear the cache via artisan, I get the following message:
The line in my file which it then points to is the ID::make(), in the default fields function from generating a schema through artisan jsonapi:schema and looking at the LaravelJsonApi\Eloquent\Fields\ID field class, it implements the LaravelJsonApi\Eloquent\Contracts\Fillable interface which extends LaravelJsonApi\Eloquent\Contracts\ReadOnly
Out of curiosity, I tried changing LaravelJsonApi\Eloquent\Contracts\ReadOnly's interface's file name and interface to ReadOnlyTest as well as updating the LaravelJsonApi\Eloquent\Fields\ID class to match and it worked fine. After this, it failed on another field because it tried to use the LaravelJsonApi\Eloquent\Fields\Concerns\ReadOnly class.
I think the ReadOnly trait / interface (and any other ReadOnly classes etc that I might have missed) should be updated for supporting PHP 8.1.
Thanks in advance
The text was updated successfully, but these errors were encountered:
Hi! See #138 - I haven't tagged PHP 8.1 version yet. So you either need to use PHP 8.0 or follow the instructions in the linked issue as to how to install the dev version of the next tag (that works with 8.1).
I should be tagging 8.1 support in the next week or so - I'm just waiting for Laravel 9 to come out as it's not worth me tagging a major for PHP 8.1 and then having to tag another major very soon after for Laravel 9. So I'm hoping to combine both of them into one major release.
I've only recently started using this package and I think there's an issue with the
LaravelJsonApi\Eloquent\Contracts\ReadOnly
interface andLaravelJsonApi\Eloquent\Fields\Concerns\ReadOnly
trait in PHP 8.1 due to readonly properties that were added: https://php.watch/versions/8.1/readonly:I followed the tutorial and when I try to clear the cache via artisan, I get the following message:
The line in my file which it then points to is the
ID::make(),
in the defaultfields
function from generating a schema throughartisan jsonapi:schema
and looking at theLaravelJsonApi\Eloquent\Fields\ID
field class, it implements theLaravelJsonApi\Eloquent\Contracts\Fillable
interface which extendsLaravelJsonApi\Eloquent\Contracts\ReadOnly
Out of curiosity, I tried changing
LaravelJsonApi\Eloquent\Contracts\ReadOnly
's interface's file name and interface toReadOnlyTest
as well as updating theLaravelJsonApi\Eloquent\Fields\ID
class to match and it worked fine. After this, it failed on another field because it tried to use theLaravelJsonApi\Eloquent\Fields\Concerns\ReadOnly
class.I think the
ReadOnly
trait / interface (and any otherReadOnly
classes etc that I might have missed) should be updated for supporting PHP 8.1.Thanks in advance
The text was updated successfully, but these errors were encountered: