Answers for "relation in same table parent with parent-child laravel"

PHP
1

laravel parent child same table

public function parent()
    {
        return $this->belongsTo('AppCourseModule','parent_id')->where('parent_id',0);
    }

    public function children()
    {
        return $this->hasMany('AppCourseModule','parent_id');
    }
Posted by: Guest on October-29-2020

Code answers related to "relation in same table parent with parent-child laravel"

Browse Popular Code Answers by Language