/**
  * get model data for edit
  *
  * @param integer $id
  * @param Request $request
  * @return Datatables
  */
 public function fastEdit($id, Request $request)
 {
     return Page::with(['category' => function ($query) {
         return $query->select(['id', 'name']);
     }])->where('id', $id)->first(['id', 'category_id', 'title', 'slug', 'description', 'is_publish']);
 }
Exemplo n.º 2
0
 public function getById($id)
 {
     $page = Page::with(['translations'])->find($id);
     return $page;
 }