Fix translation yet forced on tags
This commit is contained in:
@@ -3,11 +3,9 @@
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Spatie\Translatable\HasTranslations;
|
||||
|
||||
class Tag extends Model
|
||||
{
|
||||
use HasTranslations;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
public $translatable = ['name'];
|
||||
|
||||
@@ -56,6 +56,7 @@ class Tags
|
||||
{
|
||||
$id = $id ? $id : $data['id'];
|
||||
$tag = Tag::find($id);
|
||||
$data['name'] = ['fr' => $data['name']];
|
||||
$tag->update($data);
|
||||
return $tag;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user