src/Http/Router/Route.php
public function only()
    {
        $targets = func_get_args();

        $result = [];

        foreach ($this->targets as $method) {
            if (in_array($method, $targets)) {
                array_push($result, $method);
            } else {
                if (!is_null($this->getResourceName($this->name, $method))) {
                    foreach ($this->getResourceName($this->name, $method) as $resource) {
                        if (array_has($this->resources, $resource)) {
                            $this->resources[$resource]->delete();

                            unset($this->resources[$resource]);
                        }
                    }
                }
            }
        }

        $this->targets = $result;

        return $this;
    }
public function only()
    {
        $targets = func_get_args();

        $result = [];

        foreach ($this->targets as $method) {
            if (in_array($method, $targets)) {
                array_push($result, $method);
            } else {
                if (!is_null($this->getResourceName($this->name, $method))) {
                    foreach ($this->getResourceName($this->name, $method) as $resource) {
                        if (array_has($this->resources, $resource)) {
                            $this->resources[$resource]->delete();

                            unset($this->resources[$resource]);
                        }
                    }
                }
            }
        }

        $this->targets = $result;

        return $this;
    }
public function only ( ) { $ targets = func_get_args ( ) ; $ result = [ ] ; foreach ( $ this -> targets as $ method ) { if ( in_array ( $ method , $ targets ) ) { array_push ( $ result , $ method ) ; } else { if ( ! is_null ( $ this -> getResourceName ( $ this -> name , $ method ) ) ) { foreach ( $ this -> getResourceName ( $ this -> name , $ method ) as $ resource ) { if ( array_has ( $ this -> resources , $ resource ) ) { $ this -> resources [ $ resource ] -> delete ( ) ; unset ( $ this -> resources [ $ resource ] ) ; } } } } } $ this -> targets = $ result ; return $ this ; }
Choose the resource methods to work.

@return Route
Choose the resource methods to work .