original_string: public function store($contentId)
      {
          $content = $this->repository->getById($contentId);
          if (!empty($content)) {
              $this->authorize('create', $content);
              $this->authorize('update', $content);
              if ($content->type != 'category') {
                  $input = $this->validator->validate('create');
                  $route = $this->repository->createRoute($content, $input['lang_code'], $input['url']);
                  return $this->respondWithSuccess($route, new RouteTransformer);
              } else {
                  // TODO categories children route update
                  throw new RepositoryValidationException("You can't change category url", 500);
              }
          }
          return $this->respondNotFound();
      }
code: public function store($contentId)
      {
          $content = $this->repository->getById($contentId);
          if (!empty($content)) {
              $this->authorize('create', $content);
              $this->authorize('update', $content);
              if ($content->type != 'category') {
                  $input = $this->validator->validate('create');
                  $route = $this->repository->createRoute($content, $input['lang_code'], $input['url']);
                  return $this->respondWithSuccess($route, new RouteTransformer);
              } else {
                  // TODO categories children route update
                  throw new RepositoryValidationException("You can't change category url", 500);
              }
          }
          return $this->respondNotFound();
      }
code_tokens: public function store ( $ contentId ) { $ content = $ this -> repository -> getById ( $ contentId ) ; if ( ! empty ( $ content ) ) { $ this -> authorize ( 'create' , $ content ) ; $ this -> authorize ( 'update' , $ content ) ; if ( $ content -> type != 'category' ) { $ input = $ this -> validator -> validate ( 'create' ) ; $ route = $ this -> repository -> createRoute ( $ content , $ input [ 'lang_code' ] , $ input [ 'url' ] ) ; return $ this -> respondWithSuccess ( $ route , new RouteTransformer ) ; } else { // TODO categories children route update throw new RepositoryValidationException ( "You can't change category url" , 500 ) ; } } return $ this -> respondNotFound ( ) ; }
docstring: Stores newly created route for specified content entity in database.
  
  @param int $contentId Id of the content
  
  @return \Illuminate\Http\JsonResponse
  @throws RepositoryValidationException
docstring_tokens: Stores newly created route for specified content entity in database .