Exemple #1
0
 /**
  * Menampilkan Resource
  *
  * @param  int $id
  * @return Response
  */
 public function show($id)
 {
     $record = $this->colors->whereId($id);
     if ($record) {
         $total = 1;
         $record = $record->get()->toArray();
         return Response::json(['success' => true, 'error' => false, 'total' => $total, 'results' => $record]);
     } else {
         return Response::json(['success' => true, 'error' => true, 'reason' => 'Cannot Find Record', 'total' => 0, 'results' => array()], 404);
     }
 }