public function create($id = null)
    {
        // If an ID is supplied then we're creating a child category
        if ($id) {
            $category = $this->repository->find($id);

            if ($category) {
                return view('categories.nodes.create', [
                    'category' => $category,
                    'resource' => $this->resource,
                    'routes'   => $this->routes,
                ]);
            }
        }

        return view('categories.create', [
            'resource' => $this->resource,
            'routes'   => $this->routes,
        ]);
    }
public function create($id = null)
    {
        // If an ID is supplied then we're creating a child category
        if ($id) {
            $category = $this->repository->find($id);

            if ($category) {
                return view('categories.nodes.create', [
                    'category' => $category,
                    'resource' => $this->resource,
                    'routes'   => $this->routes,
                ]);
            }
        }

        return view('categories.create', [
            'resource' => $this->resource,
            'routes'   => $this->routes,
        ]);
    }
public function create ( $ id = null ) { // If an ID is supplied then we're creating a child category if ( $ id ) { $ category = $ this -> repository -> find ( $ id ) ; if ( $ category ) { return view ( 'categories.nodes.create' , [ 'category' => $ category , 'resource' => $ this -> resource , 'routes' => $ this -> routes , ] ) ; } } return view ( 'categories.create' , [ 'resource' => $ this -> resource , 'routes' => $ this -> routes , ] ) ; }
Shows the form for creating a new category
or category node if an ID is supplied.

@param int|string $id

@return \Illuminate\View\View
Shows the form for creating a new category or category node if an ID is supplied .