mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
build version 400
This commit is contained in:
@ -1,14 +1,30 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\PaymentMethod;
|
||||
use Crater\User;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\Models\PaymentMethod;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(PaymentMethod::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->name,
|
||||
'company_id' => User::find(1)->company_id,
|
||||
];
|
||||
});
|
||||
class PaymentMethodFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = PaymentMethod::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->name,
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user