Answers for "laravel recursive relationships"

PHP
0

laravel recursive relationships

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

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

Code answers related to "laravel recursive relationships"

Browse Popular Code Answers by Language