From 1e805ab556cfe8a5c6e2465831ee0a3bbf540974 Mon Sep 17 00:00:00 2001 From: Jeremy Postlethwaite Date: Tue, 2 Apr 2024 18:11:06 -0700 Subject: [PATCH] v73.0.0 --- database/factories/TicketFactory.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/database/factories/TicketFactory.php b/database/factories/TicketFactory.php index d9fc735..f0d157d 100644 --- a/database/factories/TicketFactory.php +++ b/database/factories/TicketFactory.php @@ -7,7 +7,6 @@ namespace Database\Factories\Playground\Matrix\Models; use Illuminate\Database\Eloquent\Factories\Factory; -use Illuminate\Support\Str; use Playground\Matrix\Models\Ticket; /** @@ -33,10 +32,24 @@ public function definition(): array { $title = $this->faker->sentence(3); + $key = $this->faker->lexify(); + $code = $this->faker->randomNumber(8); + + $slug = sprintf( + '%1$s-%2$d', + $key, + $code + ); + + $key_code_hash = md5($slug); + return [ 'label' => $this->faker->sentence(3), 'title' => $title, - 'slug' => Str::slug($title, '-'), + 'key' => $key, + 'slug' => $slug, + 'key_code_hash' => $key_code_hash, + 'code' => $code, 'description' => $this->faker->sentence(3), 'introduction' => $this->faker->sentence(3), 'content' => $this->faker->sentence(3),