Skip to content

Instantly share code, notes, and snippets.

@prapats
Last active June 18, 2016 02:02
Show Gist options
  • Select an option

  • Save prapats/a612f5e644d2e4e8e54b178403585b05 to your computer and use it in GitHub Desktop.

Select an option

Save prapats/a612f5e644d2e4e8e54b178403585b05 to your computer and use it in GitHub Desktop.

Revisions

  1. Prapat Shantavasinkul renamed this gist Jun 18, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. Prapat Shantavasinkul created this gist Jun 18, 2016.
    43 changes: 43 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    <?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');
    }