mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-05-03 16:24:55 +00:00
1f0bfba0d3
🛠️ **Factory:** Created factories for `TwitterAccount`, `EmailCampaign`, `EmailTexts`, and `BookCase`. ✨ **Helper:** Added `NostrHelper` with methods for generating fake/mocked Nostr data. ⬆️ **Dependencies:** Updated multiple Composer dependencies including `laravel/framework`, `astrotomic/laravel-translatable`, and others to their latest versions.
40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Lecturer;
|
|
use App\Models\User;
|
|
use Database\Factories\Helpers\NostrHelper;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<Lecturer>
|
|
*/
|
|
class LecturerFactory extends Factory
|
|
{
|
|
protected $model = Lecturer::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
$firstName = fake()->firstName();
|
|
$lastName = fake()->lastName();
|
|
$name = $firstName.' '.$lastName.' '.fake()->unique()->numberBetween(1, 99999);
|
|
|
|
return [
|
|
'name' => $name,
|
|
'active' => true,
|
|
'description' => fake()->paragraphs(2, true),
|
|
'subtitle' => 'Bitcoin-Pädagoge & Autor',
|
|
'intro' => fake()->paragraph(),
|
|
'twitter_username' => '@'.fake()->userName(),
|
|
'website' => 'https://'.fake()->domainName(),
|
|
'lightning_address' => NostrHelper::randomLightningAddress($firstName),
|
|
'lnurl' => null,
|
|
'node_id' => null,
|
|
'nostr' => NostrHelper::randomNpub(),
|
|
'paynym' => null,
|
|
'created_by' => User::factory(),
|
|
];
|
|
}
|
|
}
|