For explanation see Laravel Injectable package
You can install the package via composer:
composer require creativeorange/laravel-translatable-and-injectable
For support for Laravel 8 or lower, please install version 1.
Instead of using HasTranslations on your model use:
<?php
namespace App\Models;
use Creativeorange\LaravelTranslatableAndInjectable\Traits\HasTranslationsTrait;
class Question extends Model
{
use HasTranslationsTrait;
// use Spatie\Translatable\HasTranslations; remove this one
}
composer test
Please see CHANGELOG for more information what has changed recently.
The MIT License (MIT). Please see License File for more information.