Skip to content

Instantly share code, notes, and snippets.

@prapats
Last active June 20, 2016 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prapats/0862ad66b3aadc3cd434f197a4097650 to your computer and use it in GitHub Desktop.
Save prapats/0862ad66b3aadc3cd434f197a4097650 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 EducationLevel extends Model{
public $table = 'education_levels';
//
public function educationDetails(){
return $this->hasMany('EducationLevel');
}
// ????
public function educationDetails(){
return $this->hasMany('EducationLevel');
}
// ????
public function educationDetails(){
return $this->hasMany('EducationLevel');
}
}
@nguyentienlong
Copy link

I think, just one func educationDetailsOfApplication below is enough

public function educationDetailsOfApplication(){
    return $this->hasMany('EducationDetails');
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment