for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Spatie\LaravelResourceEndpoints\EndpointTypes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr;
abstract class EndpointType
{
/** @var array */
protected $parameters = [];
/** @var string|null */
protected $prefix;
protected $formatter;
abstract public function getEndpoints(Model $model = null): array;
public function parameters($parameters)
$this->parameters = Arr::wrap($parameters);
return $this;
}
public function prefix(?string $prefix)
$this->prefix = $prefix;
public function formatter(?string $formatter)
$this->formatter = $formatter;
public function hasParameters(): bool
return count($this->parameters) > 0;