MohmmedAshraf / laravel-translations

Laravel Translations UI package provides a user-friendly interface for managing translations in your Laravel application. It simplifies tasks such as adding, editing, deleting, and exporting translations. The package also includes a handy search feature and the ability to invite collaborators for easy translation management
MIT License
649 stars 91 forks source link

Incompatible Declaration of toArray Method in PhraseResource #125

Closed aqshah20 closed 4 months ago

aqshah20 commented 4 months ago

When attempting to use the package, I encounter an error due to an incompatible declaration of the toArray method in Outhebox\TranslationsUI\Http\Resources\PhraseResource. The error message is as follows:

Declaration of Outhebox\TranslationsUI\Http\Resources\PhraseResource::toArray(Illuminate\Http\Request $request) must be compatible with Illuminate\Http\Resources\Json\JsonResource::toArray($request)

MohmmedAshraf commented 4 months ago

Hi @aqshah20 , Which laravel version you use?

aqshah20 commented 4 months ago

Hello @MohmmedAshraf,

Thank you for your quick response. I was trying to install it on Laravel 9 but encountered an issue. It seems I need to upgrade my Laravel version.

MohmmedAshraf commented 4 months ago

Laravel 10/11 needed

aqshah20 commented 4 months ago

Yes, I have upgraded now working fine to me

aqshah20 commented 4 months ago

At login and after adding phrases, and publishing on every POST request, I am encountering a 419 CSRF token error. I have currently disabled CSRF in my Kernel file, but I am still experiencing this issue.