init crater

This commit is contained in:
Mohit Panjwani
2019-11-11 12:16:00 +05:30
commit bdf2ba51d6
668 changed files with 158503 additions and 0 deletions

View File

@ -0,0 +1,24 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use Laraspace\Tax;
use Laraspace\TaxType;
use Faker\Generator as Faker;
use Laraspace\User;
$factory->define(Tax::class, function (Faker $faker) {
return [
'tax_type_id' => function () {
return factory(TaxType::class)->create()->id;
},
'percent' => function (array $item) {
return TaxType::find($item['tax_type_id'])->percent;
},
'name' => function (array $item) {
return TaxType::find($item['tax_type_id'])->name;
},
'company_id' => User::find(1)->company_id,
'amount' => $faker->randomDigitNotNull
];
});