Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Primary Termlaravel recursive relationships

class Item extends Model {
  protected $with = ['children'];

  public function children() {
    $this->hasMany(AppItems::class, 'parent_id', 'id');
 }
}
 
PREVIOUS NEXT
Tagged: #Primary #Termlaravel #recursive #relationships
ADD COMMENT
Topic
Name
5+1 =