for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace MichaelRubel\Couponables\Models\Traits;
use Illuminate\Database\Eloquent\Model;
trait DefinesColumnChecks
{
/**
* @return bool
*/
public function isMorphColumnsFilled(): bool
return ! is_null($this->{static::getRedeemerTypeColumn()})
&& ! is_null($this->{static::getRedeemerIdColumn()});
}
public function isOnlyRedeemerTypeFilled(): bool
&& is_null($this->{static::getRedeemerIdColumn()});
* @param Model $model
*
public function isSameRedeemerModel(Model $model): bool
return $this->{self::$bindable->getRedeemerTypeColumn()} === $model->getMorphClass();