محل تبلیغات شما
کافیه این رابطه رو توی مدل مربوطه بنویسید

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

مشخصات

آخرین مطالب این وبلاگ

برترین جستجو ها

آخرین جستجو ها

KING RECORD ciomechecpalb ventichande china authentic wholesale jerseys & free shipping garendivol profcorbeti nallelahou John's memory stabtiofrenes انوش گپ