Initial commit: Pireon Admin — headless admin panel and public API
Laravel 13 + Filament 5 admin panel and REST API for a non-profit developer collective, backed by the Pireon OAuth identity server. The public site is a separate, server-rendered application consuming /api/public/v1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
44
database/factories/TalkFactory.php
Normal file
44
database/factories/TalkFactory.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Talk;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<Talk>
|
||||
*/
|
||||
class TalkFactory extends Factory
|
||||
{
|
||||
protected $model = Talk::class;
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'title' => rtrim(fake()->unique()->catchPhrase(), '.'),
|
||||
'language' => (string) config('locales.default'),
|
||||
'summary' => $this->eachLocale(fn () => fake()->sentence(14)),
|
||||
'event' => fake()->randomElement([
|
||||
'Codemotion', 'T3chFest', 'JSDay', 'PHPBarcelona', 'Meetup Laravel',
|
||||
]),
|
||||
'city' => fake()->randomElement(['Madrid', 'Barcelona', 'Valencia', 'Sevilla']),
|
||||
'held_at' => fake()->dateTimeBetween('-3 years'),
|
||||
'video_url' => fake()->optional(0.6)->url(),
|
||||
'slides_url' => fake()->optional(0.4)->url(),
|
||||
'is_public' => true,
|
||||
];
|
||||
}
|
||||
|
||||
/** @return array<string, string> */
|
||||
protected function eachLocale(callable $value): array
|
||||
{
|
||||
return collect(array_keys(config('locales.supported')))
|
||||
->mapWithKeys(fn (string $l) => [$l => $value($l)])
|
||||
->all();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user