Exemple #1
0
 /**
  *
  * Proses Simpan Colors
  *
  * @return mixed
  */
 public function store()
 {
     if (!$this->hasAccess()) {
         return Response::json(array('success' => false, 'reason' => 'Action Need Login First', 'results' => null))->setCallback();
     }
     /*==========  Sesuaikan dengan Field di table  ==========*/
     $this->colors->name = Input::get('name');
     $this->colors->info = Input::get('info');
     $this->colors->uuid = uniqid('New_');
     $this->colors->createby_id = \Auth::user()->id;
     $this->colors->lastupdateby_id = \Auth::user()->id;
     $this->colors->created_at = new Carbon();
     $this->colors->updated_at = new Carbon();
     $saved = $this->colors->save() ? true : false;
     return Response::json(array('success' => $saved, 'results' => $this->colors->toArray()))->setCallback();
 }