Tag blog posts and sign them with a member
Tags are named in every language and made from the page form; the byline is the member who signs a post on the site. The public API sends both, filters posts by tag and lists the tags in use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
25
database/factories/TagFactory.php
Normal file
25
database/factories/TagFactory.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Tag;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends Factory<Tag>
|
||||
*/
|
||||
class TagFactory extends Factory
|
||||
{
|
||||
public function definition(): array
|
||||
{
|
||||
$name = $this->faker->unique()->word();
|
||||
|
||||
return [
|
||||
'name' => ['es' => $name, 'en' => $name, 'ca' => $name],
|
||||
'slug' => ['es' => Str::slug($name), 'en' => Str::slug($name), 'ca' => Str::slug($name)],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user