Fix finding expenses call #130
This commit is contained in:
18
app/Database/factories/ExpenseFactory.php
Normal file
18
app/Database/factories/ExpenseFactory.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Enums\ExpenseType;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Expense::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'airline_id' => function () {
|
||||
return factory(App\Models\Airline::class)->create()->id;
|
||||
},
|
||||
'name' => $faker->text(20),
|
||||
'amount' => $faker->randomFloat(2, 100, 1000),
|
||||
'type' => ExpenseType::FLIGHT,
|
||||
'multiplier' => false,
|
||||
'active' => true,
|
||||
];
|
||||
});
|
||||
@@ -30,6 +30,7 @@ class ExpenseRepository extends BaseRepository implements CacheableInterface
|
||||
{
|
||||
$expenses = $this->findWhere([
|
||||
'type' => $type,
|
||||
['airline_id', '=', null]
|
||||
]);
|
||||
|
||||
if($airline_id) {
|
||||
|
||||
Reference in New Issue
Block a user