Trouble with show data from own model
Hi, there is an element AdminColumn::text. If I use it with relationships with 2 models - everything is OK. But I have One model: Categories with fields id,name,alias,parent_id,created_at,updated_at and I want to show parent category name on view. Can anybody help me in what direction to look for solution. Thanks
I get solution with AdminColumn's custom method here is my code:
AdminColumn::custom()->setLabel('Parent Category')->setCallback(function($model){ $oParentCategory = Category::where('parent_id', $model->parent_id)->first(); return $oParentCategory->name; })
@tomastovt please use https://github.com/LaravelRUS/SleepingOwlAdmin