mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
29
database/factories/GitHookFactory.php
Normal file
29
database/factories/GitHookFactory.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\GitHook;
|
||||
use App\Models\Site;
|
||||
use App\Models\SourceControl;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class GitHookFactory extends Factory
|
||||
{
|
||||
protected $model = GitHook::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'secret' => $this->faker->word(),
|
||||
'events' => $this->faker->words(),
|
||||
'actions' => $this->faker->words(),
|
||||
'hook_id' => $this->faker->word(),
|
||||
'hook_response' => $this->faker->words(),
|
||||
'created_at' => Carbon::now(),
|
||||
'updated_at' => Carbon::now(),
|
||||
'site_id' => Site::factory(),
|
||||
'source_control_id' => SourceControl::factory(),
|
||||
];
|
||||
}
|
||||
}
|
@ -13,7 +13,6 @@ class SourceControlFactory extends Factory
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'provider' => $this->faker->randomElement(\App\Enums\SourceControl::getValues()),
|
||||
'access_token' => Str::random(10),
|
||||
];
|
||||
}
|
||||
@ -44,13 +43,4 @@ public function bitbucket(): Factory
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function custom(): Factory
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'provider' => \App\Enums\SourceControl::CUSTOM,
|
||||
];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user