I have User that has many Posts.
Bellow the User edit form I want to show the related Posts 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);
}
Thanks
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2ldKS2a
via IFTTT
Aucun commentaire:
Enregistrer un commentaire