Spatie\Translatable\Exceptions\AttributeIsNotTranslatable::make PHP Метод

make() публичный статический Метод

public static make ( string $key, Model $model )
$key string
$model Illuminate\Database\Eloquent\Model
    public static function make(string $key, Model $model)
    {
        $translatable = implode(', ', $model->getTranslatableAttributes());
        return new static("Cannot translate attribute `{$key}` as it's not one of the translatable attributes: `{$translatable}`");
    }

Usage Example

 protected function guardAgainstUntranslatableAttribute(string $key)
 {
     if (!$this->isTranslatableAttribute($key)) {
         throw AttributeIsNotTranslatable::make($key, $this);
     }
 }
AttributeIsNotTranslatable