public function parent()
{return $this->belongsTo('App\CourseModule','parent_id')->where('parent_id',0)->with('parent');}public function children(){return $this->hasMany('App\CourseModule','parent_id')->with('children');}بعدشم توی کنترلرتون اینطوری دسته بندیهارو بگیریدCategory::where([['parent_id',null],['active',1]])->with('children')->get();
دسته بندی با بی تهایت زیردسته بندی
حذف از کالکشن با شرط در لاراول - Remove from a collection on a condition in Laravel
parent ,id ,children ,with ,this ,appcoursemodule ,parent id ,where parent ,return this ,appcoursemodule parent ,with children
درباره این سایت