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
<?php
namespace App\Models;
use App\Models\Translations\BlogTranslation;
use Astrotomic\Translatable\Translatable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Blog extends Model
{
use HasFactory;
use Translatable;
protected $guarded = [];
public $translationModel = BlogTranslation::class;
protected array $translatedAttributes = [
'title',
'slug',
'content'
];
}
BlogTranslation.php
<?php
namespace App\Models\Translations;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class BlogTranslation extends Model
{
use HasFactory;
public $timestamps = false;
protected $fillable = [
'title',
'slug',
'content'
];
}
In readme it is mentioned it works with the dimsav/laravel-translatable, but it is not maintained anymore, but there is a fork of it https://github.com/Astrotomic/laravel-translatable
I have setup migration and model
Blog.php
BlogTranslation.php
BlogResoure.php
But trying to create a record it throws error: Array to string conversion
The text was updated successfully, but these errors were encountered: