mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
34 lines
662 B
PHP
34 lines
662 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Client;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Project>
|
|
*/
|
|
class ProjectFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
|
|
public function definition()
|
|
{
|
|
$name = fake()->country();
|
|
|
|
$client = Client::all()->random();
|
|
|
|
return [
|
|
'client_id' => $client->id,
|
|
'name' => 'Project ' . $name,
|
|
'code' => strtoupper(substr($name, 0, 3)) . '-2023-' . rand(1, 50),
|
|
];
|
|
|
|
|
|
}
|
|
}
|