-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2710bd1
commit 107189e
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace Database\Factories; | ||
|
||
use App\Models\User; | ||
use App\Models\Team; | ||
use Illuminate\Support\Str; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
/** | ||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Draft> | ||
*/ | ||
class DraftFactory extends Factory | ||
{ | ||
/** | ||
* Define the model's default state. | ||
* | ||
* @return array<string, mixed> | ||
*/ | ||
public function definition() | ||
{ | ||
$user = User::factory()->withPersonalTeam()->create(); | ||
$key = Str::uuid(); | ||
$environment = env('APP_ENV', 'local'); | ||
$path = $environment.'/'.$user->id.'/drafts/'.$key; | ||
|
||
return [ | ||
'name' => Str::random(), | ||
'slug' => Str::random(), | ||
'description' => $this->faker->text(), | ||
'relative_url' => "/".$this->faker->uuid(), | ||
'path' => $path, | ||
'key' => Str::uuid(), | ||
'is_deleted' => "False", | ||
'owner_id' => $user->id, | ||
'team_id' => Team::factory(), | ||
'info' => "{}", | ||
'settings' => "{}", | ||
]; | ||
} | ||
} |