ldc-groupe/app/Contracts/TranslatableModel.php
2025-10-17 14:52:59 +02:00

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;
}