good
This commit is contained in:
26
database/factories/CouponFactory.php
Normal file
26
database/factories/CouponFactory.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Coupon;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends Factory<Coupon>
|
||||
*/
|
||||
class CouponFactory extends Factory
|
||||
{
|
||||
protected $model = Coupon::class;
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'phone' => '6'.fake()->unique()->numerify('#######'),
|
||||
'code' => random_int(1, 9).'_'.Str::upper(Str::random(4)),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user