Add factories
This commit is contained in:
parent
89d85e8010
commit
8543faf213
database/factories/Payment
|
@ -16,7 +16,10 @@ class PaymentFactory extends Factory
|
|||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
'nr' => $this->faker->year,
|
||||
'subscription_id' => Subscription::factory()->create()->id,
|
||||
'status_id' => Status::factory()->create()->id,
|
||||
'last_remembered_at' => $this->faker->dateTime,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories\Payment;
|
||||
|
||||
use App\Payment\Status;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class StatusFactory extends Factory
|
||||
{
|
||||
|
||||
public $model = Status::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->sentence,
|
||||
'is_bill' => $this->faker->boolean,
|
||||
'is_remember' => $this->faker->boolean,
|
||||
];
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Database\Factories\Payment;
|
||||
|
||||
use App\Fee;
|
||||
use App\Payment\Subscription;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
|
@ -13,8 +14,9 @@ class SubscriptionFactory extends Factory
|
|||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->name,
|
||||
'name' => $this->faker->word,
|
||||
'amount' => $this->faker->numberBetween(1000, 50000),
|
||||
'fee_id' => Fee::factory()->create()->id,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue