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