skip available currencies
This commit is contained in:
parent
74b0d420a9
commit
c71379c56b
@ -8,9 +8,15 @@ $user = User::first();
|
|||||||
$company = $user->companies()->first();
|
$company = $user->companies()->first();
|
||||||
|
|
||||||
$factory->define(Currency::class, function (Faker $faker) use ($company) {
|
$factory->define(Currency::class, function (Faker $faker) use ($company) {
|
||||||
|
session(['company_id' => $company->id]);
|
||||||
setting()->setExtraColumns(['company_id' => $company->id]);
|
setting()->setExtraColumns(['company_id' => $company->id]);
|
||||||
|
|
||||||
$currencies = config('money');
|
$currencies = config('money');
|
||||||
|
|
||||||
|
Currency::pluck('code')->each(function ($db_code) use (&$currencies) {
|
||||||
|
unset($currencies[$db_code]);
|
||||||
|
});
|
||||||
|
|
||||||
$random = $faker->randomElement($currencies);
|
$random = $faker->randomElement($currencies);
|
||||||
|
|
||||||
$filtered = array_filter($currencies, function ($value) use ($random) {
|
$filtered = array_filter($currencies, function ($value) use ($random) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user