28 lines
617 B
PHP
28 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());
|
||
|
|
}
|
||
|
|
}
|