Answers for "Primary Termlaravel recursive relationships"

PHP
0

Primary Termlaravel recursive relationships

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

  public function children() {
    $this->hasMany(App\Items::class, 'parent_id', 'id');
 }
}
Posted by: Guest on March-18-2022

Browse Popular Code Answers by Language