ekmungai/eloquent-ifrs

View on GitHub
database/factories/VatFactory.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

/**
 * @var \Illuminate\Database\Eloquent\Factory $factory
 */

use Faker\Generator as Faker;

use IFRS\Models\Vat;
use IFRS\Models\Account;

$factory->define(
    Vat::class,
    function (Faker $faker) {
        return [
            'name' => $faker->name,
            'code' => $faker->randomLetter(),
            'rate' => $faker->randomDigit(),
            'account_id' => factory(Account::class)->create([
                'account_type' => Account::CONTROL,
                'category_id' => null
            ])->id,
        ];
    }
);