- Ajout de jobs de lint, test, ci - Refactoring de code - montée de version sur laravel 13 uniquement et php8.5
27 lines
617 B
PHP
27 lines
617 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Uwil\SitemapGenerator\Tests\Unit\Config;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Spatie\Sitemap\Tags\Url;
|
|
use Uwil\SitemapGenerator\Contracts\Sitemapable;
|
|
|
|
class ModelClass extends Model implements Sitemapable
|
|
{
|
|
protected $guarded = [];
|
|
|
|
#[\Override]
|
|
public function getLocalizedUrl(string $locale): string
|
|
{
|
|
return "http://localhost/{$locale}/posts";
|
|
}
|
|
|
|
/** @return Url|string|string[] */
|
|
#[\Override]
|
|
public function toSitemapTag(): Url | string | array
|
|
{
|
|
return $this->getLocalizedUrl(app()->getLocale());
|
|
}
|
|
}
|