コード例 #1
0
 /**
  * Create a new resource.
  *
  * @param  CreateRequest
  * @return Response
  */
 public function store(CreateRequest $request)
 {
     // The 'parent_id' attribute is guarded so it will be ignored and
     // the node will be saved as a root node
     $response = parent::_store($request);
     // If 'parent_id' was provided attach the newly created node to the provided parent
     if ($parentId = intval($request->input('parent_id'))) {
         $this->resource->makeChildOf(Model::findOrFail($parentId));
     }
     return $response;
 }
コード例 #2
0
ファイル: UserController.php プロジェクト: superdol/Wiki
 /**
  * Create a new resource.
  *
  * @param  CreateRequest
  * @return Response
  */
 public function store(CreateRequest $request)
 {
     return parent::_store($request);
 }