mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-25 11:19:39 +03:00
21 lines
391 B
PHP
21 lines
391 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace BookStack\Entities;
|
||
|
|
|
||
|
|
use Illuminate\Validation\Rules\Exists;
|
||
|
|
|
||
|
|
class EntityExistsRule implements \Stringable
|
||
|
|
{
|
||
|
|
public function __construct(
|
||
|
|
protected string $type,
|
||
|
|
) {
|
||
|
|
}
|
||
|
|
|
||
|
|
public function __toString()
|
||
|
|
{
|
||
|
|
$existsRule = (new Exists('entities', 'id'))
|
||
|
|
->where('type', $this->type);
|
||
|
|
return $existsRule->__toString();
|
||
|
|
}
|
||
|
|
}
|