Exemplo n.º 1
0
 public function all_categories($type = 'post')
 {
     $lists = [];
     $categories = $this->model->where('type', '=', $type)->get();
     foreach ($categories as $item) {
         $lists[$item->id] = $item->title;
     }
     return $lists;
 }
Exemplo n.º 2
0
 public function getPost($id)
 {
     return $this->model->where('id', '=', $id)->first();
 }