/ database / factories / NormScopeFactory.php
NormScopeFactory.php
 1  <?php
 2  
 3  namespace Database\Factories;
 4  
 5  use App\Models\Norm;
 6  use App\Models\NormScope;
 7  use Illuminate\Database\Eloquent\Factories\Factory;
 8  
 9  class NormScopeFactory extends Factory
10  {
11      /**
12       * The name of the factory's corresponding model.
13       *
14       * @var string
15       */
16      protected $model = NormScope::class;
17  
18      /**
19       * Define the model's default state.
20       *
21       * @return array
22       */
23      public function definition()
24      {
25          return [
26              'name' => $this->faker->word,
27              'description' => $this->faker->text(25),
28              'norm_id' => Norm::inRandomOrder()->first()->id,
29          ];
30      }
31  }