*/ public function definition(): array { return [ 'name' => $this->faker->words(5, true), 'key' => str($this->faker->words(5, true))->snake()->toString(), 'type' => $this->faker->randomElement(array_column(Field::asMeta(), 'id')), 'columns' => ['mobile' => 2, 'tablet' => 4, 'desktop' => 6], 'default' => '', ]; } /** * @param string|class-string $field */ public function type(string $field): self { if (!$field || !class_exists($field)) { return $this->state(['type' => $field]); } return $this->state([ 'type' => $field::type(), ...$field::fake($this->faker), ]); } /** * @param mixed $args */ public function __call(string $method, $args): self { return $this->state([$method => $args[0]]); } }