Initial commit

This commit is contained in:
Ronald Huynen
2026-03-23 21:37:59 +01:00
commit 2547717edb
2193 changed files with 972171 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
<?php
namespace App\Models;
use App\Models\Tag;
use App\Traits\TaggableWithLocale;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;
class TaggableLocale extends Model
{
use HasFactory;
use TaggableWithLocale;
protected $table = 'taggable_locales';
protected static function boot()
{
parent::boot();
// updating created_by and updated_by when model is created
static::creating(function ($model) {
if (!$model->isDirty('updated_by_user')) {
$model->updated_by_user = Auth::guard('web')->user()->id;
}
});
// updating updated_by when model is updated
static::updating(function ($model) {
if (!$model->isDirty('updated_by_user')) {
$model->updated_by_user = Auth::guard('web')->user()->id;
}
});
}
protected $guarded = [];
public function tag()
{
return $this->belongsTo(Tag::class, 'taggable_tag_id', 'tag_id');
}
}