for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Leonidas\Library\System\Post\Policies;
use Leonidas\Contracts\Http\ServerRequestPolicyInterface;
use Leonidas\Traits\ExpectsPostTrait;
use Psr\Http\Message\ServerRequestInterface;
class PostPolicy implements ServerRequestPolicyInterface
{
use ExpectsPostTrait;
Leonidas\Traits\ExpectsPostTrait
$ID
Leonidas\Library\System\Post\Policies\PostPolicy
/**
* @var int[]
*/
protected $posts = [];
*
public function __construct(int ...$posts)
$this->posts = $posts;
}
* Get the value of posts
* @return int[]
public function getPosts(): array
return $this->posts;
public function approvesRequest(ServerRequestInterface $request): bool
return in_array($this->getPostId($request), $this->posts);