src/Traits/ApiActionsChilds.php
public function childStoreWithPivot($idParent, $request, $relation)
    {
        $idParent = $this->getRealId($idParent);
        
        $resource = $this->repository->storeChildAndPivot($idParent, $relation, $request->all());
        
        if (! $resource) {
            // return $this->notFound();
        }
        
        return $this->success($resource);
    }
public function childStoreWithPivot($idParent, $request, $relation)
    {
        $idParent = $this->getRealId($idParent);
        
        $resource = $this->repository->storeChildAndPivot($idParent, $relation, $request->all());
        
        if (! $resource) {
            // return $this->notFound();
        }
        
        return $this->success($resource);
    }
public function childStoreWithPivot ( $ idParent , $ request , $ relation ) { $ idParent = $ this -> getRealId ( $ idParent ) ; $ resource = $ this -> repository -> storeChildAndPivot ( $ idParent , $ relation , $ request -> all ( ) ) ; if ( ! $ resource ) { // return $this->notFound(); } return $ this -> success ( $ resource ) ; }
Create and associate a new child

@return \Illuminate\Http\Response
Create and associate a new child