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
+39
View File
@@ -0,0 +1,39 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* BaseModel replaces the CodeIgniter Model and wires up the legacy builder
* and database utility that the existing models expect.
*/
class BaseModel extends Model
{
use HasFactory;
public CiDatabase $db;
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$this->db = CiDatabase::instance();
}
/**
* Ensure our legacy builder is used so the old helper methods remain available.
*/
public function newEloquentBuilder($query)
{
return new CiModelBuilder($query);
}
/**
* Keep the familiar CodeIgniter helper available on the model itself.
*/
public function findAll($limit = 0, $offset = 0)
{
return $this->newModelQuery()->findAll($limit, $offset);
}
}