$this->faker->unique()->catchPhrase(), ]; } public function mobile() { return $this->state(function () { return [ 'name' => 'Mobile Devices', ]; }); } public function computer() { return $this->state(function () { return [ 'name' => 'Laptops and Desktops', ]; }); } public function hasEncryptedCustomField(CustomField $field = null) { return $this->afterCreating(function (CustomFieldset $fieldset) use ($field) { $field = $field ?? CustomField::factory()->testEncrypted()->create(); $fieldset->fields()->attach($field, ['order' => '1', 'required' => false]); }); } }