This commit is contained in:
Ludovic CANDELLIER
2021-11-07 17:16:35 +01:00
parent 46b751c361
commit c7c8e18cbc
11 changed files with 41 additions and 35 deletions

View File

@@ -4,8 +4,12 @@ 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'];
@@ -40,9 +44,4 @@ class Tag extends Model
{
return $query->where($this->table . '.tag_group_id', $id);
}
public function getNameAttribute($value)
{
return json_decode($value)->fr ?? false;
}
}