add projet

This commit is contained in:
root
2026-03-05 12:29:37 -05:00
parent 8d1eef8ba8
commit 23b7db1107
9109 changed files with 1106501 additions and 73 deletions
+55
View File
@@ -0,0 +1,55 @@
<?php
namespace App\Models;
use App\Models\BaseModel;
class Section extends BaseModel
{
protected $table = 'sections';
protected $primaryKey = 'id';
protected $fillable = [
'section_name',
'description',
'updated_at',
'updated_by',
];
public $timestamps = false;
const CREATED_AT = 'created_at';
const UPDATED_AT = 'updated_at';
/**
* Get section by name.
*
* @param string $sectionName
* @return array|null
*/
public function getSectionByName($sectionName)
{
return $this->where('section_name', $sectionName)->first();
}
/**
* Update section details by ID.
*
* @param int $sectionId
* @param array $data
* @return bool
*/
public function updateSection($sectionId, $data)
{
$data['updated_at'] = utc_now(); // Set the updated_at timestamp
return $this->update($sectionId, $data);
}
/**
* Delete section by ID.
*
* @param int $sectionId
* @return bool
*/
public function deleteSection($sectionId)
{
return $this->delete($sectionId);
}
}