add projet
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\BaseModel;
|
||||
|
||||
class Settings extends BaseModel
|
||||
{
|
||||
protected $table = 'settings';
|
||||
protected $primaryKey = 'id';
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'timezone',
|
||||
'updated_by',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
public $timestamps = true;
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
public function getSettings()
|
||||
{
|
||||
return $this->findAll()[0]; // Assuming there's only one settings record
|
||||
}
|
||||
|
||||
public function updateSettings($data)
|
||||
{
|
||||
return $this->update(1, $data); // Assuming there's only one settings record
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user