Add project repository connection settings
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Actions\Git\GitProviderKey;
|
||||
use App\Models\Project;
|
||||
use App\Models\RepositoryConnection;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<RepositoryConnection>
|
||||
*/
|
||||
class RepositoryConnectionFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'base_url' => 'https://git.'.fake()->domainName(),
|
||||
'owner_name' => fake()->userName(),
|
||||
'project_id' => Project::factory(),
|
||||
'provider' => GitProviderKey::Gitea,
|
||||
'provider_repository_id' => (string) fake()->numberBetween(1, 999_999),
|
||||
'repository_full_name' => fake()->userName().'/'.fake()->slug(),
|
||||
'repository_name' => fake()->slug(),
|
||||
'repository_url' => 'https://git.'.fake()->domainName().'/'.fake()->userName().'/'.fake()->slug(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user