3 namespace Database\Factories\Sorting;
5 use BookStack\Sorting\SortRule;
6 use BookStack\Sorting\SortRuleOperation;
7 use Illuminate\Database\Eloquent\Factories\Factory;
9 class SortRuleFactory extends Factory
12 * The name of the factory's corresponding model.
16 protected $model = SortRule::class;
19 * Define the model's default state.
21 public function definition(): array
23 $cases = SortRuleOperation::cases();
24 $op = $cases[array_rand($cases)];
26 'name' => $op->name . ' Sort',
27 'sequence' => $op->value,