24 lines
561 B
PHP
24 lines
561 B
PHP
<?php
|
|
|
|
namespace App\Contracts;
|
|
|
|
interface TranslatableModel
|
|
{
|
|
/**
|
|
* Get all translatable attributes.
|
|
*
|
|
* @param string|null $key
|
|
* @param array|null $allowedLocales
|
|
* @return array
|
|
*/
|
|
public function getTranslations(?string $key = null, ?array $allowedLocales = null): array;
|
|
|
|
/**
|
|
* Verefy that a specific attribute has locale.
|
|
*
|
|
* @param string $key
|
|
* @param string|null $locale
|
|
* @return boolean
|
|
*/
|
|
public function hasTranslation(string $key, ?string $locale = null): bool;
|
|
}
|