RevisionFactory.php
1 <?php 2 3 namespace Database\Factories; 4 5 use App\Models\Document; 6 use App\Models\Revision; 7 use App\Models\Template; 8 use App\Models\User; 9 use Illuminate\Database\Eloquent\Factories\Factory; 10 use Illuminate\Support\Carbon; 11 12 class RevisionFactory extends Factory 13 { 14 15 public function definition(): array 16 { 17 return [ 18 'hash' => $this->faker->word(), 19 'path' => $this->faker->word(), 20 'name' => $this->faker->name(), 21 'version' => $this->faker->word(), 22 'size' => $this->faker->randomNumber(), 23 'from' => $this->faker->word(), 24 'approved' => $this->faker->boolean(), 25 'reviewed' => $this->faker->boolean(), 26 'created_at' => Carbon::now(), 27 'updated_at' => Carbon::now(), 28 'document_id' => Document::factory(), 29 'created_by' => User::first(), 30 'approved_by' => User::first(), 31 'reviewed_by' => User::first(), 32 'template_id' => 1, 33 'description' => $this->faker->word(), 34 ]; 35 } 36 }