ReadOnlyTraitLaravel
ReadOnlyTraitLaravel copied to clipboard
Laravel 9 compatibility issue
When a recently upgrade my system that uses ReadOnlyTrait, the following error is showed:
Declaration of MichaelAChrisco\ReadOnly\ReadOnlyTrait::touch() must be compatible with Illuminate\Database\Eloquent\Model::touch($attribute = null)
To correct this error, I just change line 163 in ReadOnlyTrait:
public function touch()
to
public function touch($attribute = null)
And now it's working well.
Thanks.
BTW: Before I open this issue, I had try open a PR, but github doesn't allow me.