I have User
that has many Post
s.
Bellow the User
edit form I want to show the related Post
s grid.
The following function will bring the related posts.
How can I combine it above/inside/bellow the edit User
form?
I know this function will work, just don't know how to combine it.
// user crud controller
public function getUserRlatedPosts($user_id)
{
$crud = new CrudPanel();
$crud->addClause('where', 'user_id', '=', $user_id);
$crud->setModel("post");
$crud->setEntityNameStrings("post","posts");
$crud->enableAjaxTable();
$this->data['crud'] = $crud;
$this->data['title'] = ucfirst($this->crud->entity_name_plural);
if (! $this->data['crud']->ajaxTable()) {
$this->data['entries'] = $this->data['crud']->getEntries();
}
return view('crud::list', $this->data);
}