Example #1
0
 function fetch($id)
 {
     $data = events::where('id', $id)->first()->toArray();
     $data['eventDescription'] = htmlspecialchars_decode($data['eventDescription'], ENT_QUOTES);
     return json_encode($data);
 }
 public function readNewsEvent($type, $id)
 {
     if ($type == "news") {
         return newsboard::where('id', $id)->first();
     }
     if ($type == "event") {
         return events::where('id', $id)->first();
     }
 }