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;
 }
Beispiel #2
0
 public function getPost($id)
 {
     return $this->model->where('id', '=', $id)->first();
 }