first commit

This commit is contained in:
2025-03-05 20:28:54 -06:00
parent f54ca8e341
commit 68ca619829
570 changed files with 111124 additions and 175 deletions

39
Models/Setting.php Normal file
View File

@ -0,0 +1,39 @@
<?php
namespace Koneko\VuexyAdmin\Models;
use Illuminate\Database\Eloquent\Model;
class Setting extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'key',
'value',
'user_id',
];
public $timestamps = false;
// Relación con el usuario
public function user()
{
return $this->belongsTo(User::class);
}
// Scope para obtener configuraciones de un usuario específico
public function scopeForUser($query, $userId)
{
return $query->where('user_id', $userId);
}
// Configuraciones globales (sin usuario)
public function scopeGlobal($query)
{
return $query->whereNull('user_id');
}
}