reconstruction of the project
This commit is contained in:
+21
-3
@@ -2,11 +2,15 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Models\BaseModel;
|
||||
|
||||
class Family extends Model
|
||||
class Family extends BaseModel
|
||||
{
|
||||
protected $table = 'families';
|
||||
|
||||
// CI model didn't specify timestamps
|
||||
public $timestamps = true;
|
||||
|
||||
protected $fillable = [
|
||||
'family_code',
|
||||
'household_name',
|
||||
@@ -23,5 +27,19 @@ class Family extends Model
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
public $timestamps = true;
|
||||
|
||||
protected $casts = [
|
||||
'is_active' => 'boolean',
|
||||
];
|
||||
|
||||
/* Optional relationships */
|
||||
public function guardians()
|
||||
{
|
||||
return $this->hasMany(FamilyGuardian::class, 'family_id');
|
||||
}
|
||||
|
||||
public function commPrefs()
|
||||
{
|
||||
return $this->hasMany(FamilyCommPref::class, 'family_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user