예제 #1
0
 /**
  * Execute custom action on model.
  *
  * @param string $entity
  * @param $id
  * @param string $action
  *
  * @return \Illuminate\Http\Response
  */
 public function executeCustomAction($entity, $id, $action = null)
 {
     $entity = $this->resolve($entity, Entity::UPDATE);
     $this->assertEntity($entity);
     $data = new EntityData($entity, []);
     $data->setId($id);
     $data->setCustomAction($action);
     $data->save();
     return new JsonResponse();
 }
예제 #2
0
파일: InnerData.php 프로젝트: guratr/cruddy
 /**
  * @param Model $model
  */
 protected function fillModel(Model $model)
 {
     parent::fillModel($model);
     $this->relation->attach($model, $this->parent);
 }