Skip to content

Instantly share code, notes, and snippets.

@prapats
Last active June 18, 2016 02:02
Show Gist options
  • Save prapats/a612f5e644d2e4e8e54b178403585b05 to your computer and use it in GitHub Desktop.
Save prapats/a612f5e644d2e4e8e54b178403585b05 to your computer and use it in GitHub Desktop.
<?php
class EducationDetail extends Model{
fatherEducationLevel{
return $this->belongsToOne('EducationLevel');
}
motherEducationLevel{
return $this->belongsToOne('EducationLevel');
}
sisterEducationLevel{
return $this->belongsToOne('EducationLevel');
}
}
class FatherEducationLevel extends Model{
public $table = 'education_levels';
//
public function educationDetails(){
return $this->hasMany('EducationLevel');
}
class MotherEducationLevel extends Model{
public $table = 'education_levels';
//
public function educationDetails(){
return $this->hasMany('EducationLevel');
}
class SisterEducationLevel extends Model{
public $table = 'education_levels';
//
public function educationDetails(){
return $this->hasMany('EducationLevel');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment