Adamgoose\Routing\Annotations\Annotations\Resource::extractFromEndpoints PHP Method

extractFromEndpoints() protected method

Extract method items from endpoints for the given key.
protected extractFromEndpoints ( EndpointCollection $endpoints, string $key ) : array
$endpoints Adamgoose\Routing\Annotations\EndpointCollection
$key string
return array
    protected function extractFromEndpoints(EndpointCollection $endpoints, $key)
    {
        $items = ['index' => [], 'create' => [], 'store' => [], 'show' => [], 'edit' => [], 'update' => [], 'destroy' => []];
        foreach ($this->getEndpointsWithResourceMethods($endpoints, $key) as $endpoint) {
            $items[$endpoint->method] = array_merge($items[$endpoint->method], $endpoint->{$key});
        }
        return $items;
    }