<?php
namespace Silber\Bouncer\Constraints;
use Illuminate\Database\Eloquent\Model;
class ValueConstraint extends Constraint
{
protected $column;
protected $value;
public function __construct($column, $operator, $value)
{
$this->column = $column;
$this->operator = $operator;
$this->value = $value;
}
public function check(Model $entity, ?Model $authority = null)
{
return $this->compare($entity->{$this->column}, $this->value);
}