reconstruction of the project
This commit is contained in:
@@ -7,7 +7,10 @@ use App\Models\BaseModel;
|
||||
class ParentModel extends BaseModel
|
||||
{
|
||||
protected $table = 'parents';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
// CI model didn't specify timestamps
|
||||
public $timestamps = true;
|
||||
|
||||
protected $fillable = [
|
||||
'secondparent_firstname',
|
||||
'secondparent_lastname',
|
||||
@@ -21,5 +24,14 @@ class ParentModel extends BaseModel
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
public $timestamps = true;
|
||||
}
|
||||
|
||||
protected $casts = [
|
||||
'firstparent_id' => 'integer',
|
||||
];
|
||||
|
||||
/* Optional relationship */
|
||||
public function firstParentUser()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'firstparent_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user