Fixed more camel-casing -> snake-casing

This commit is contained in:
snipe 2019-05-24 16:01:12 -07:00
parent d5c3ee5ed0
commit 56576d9e45
4 changed files with 5 additions and 5 deletions

View file

@ -39,7 +39,7 @@ class SyncAssetCounters extends Command
public function handle()
{
$start = microtime(true);
$assets = Asset::withCount('checkins', 'checkouts', 'userRequests')
$assets = Asset::withCount('checkins as checkins_count', 'checkouts as checkouts_count', 'userRequests as user_requests_count')
->withTrashed()->get();
if ($assets) {

View file

@ -281,7 +281,7 @@ class Helper
*/
public static function checkLowInventory()
{
$consumables = Consumable::withCount('consumableAssignments as consumableAssignments_count')->whereNotNull('min_amt')->get();
$consumables = Consumable::withCount('consumableAssignments as consumable_assignments_count')->whereNotNull('min_amt')->get();
$accessories = Accessory::withCount('users as users_count')->whereNotNull('min_amt')->get();
$components = Component::withCount('assets as assets_count')->whereNotNull('min_amt')->get();

View file

@ -41,7 +41,7 @@ class LocationsController extends Controller
'locations.updated_at',
'locations.image',
'locations.currency'
])->withCount('assignedAssets as assignedAssets_count')
])->withCount('assignedAssets as assigned_assets_count')
->withCount('assets as assets_count')
->withCount('users as users_count');
@ -123,7 +123,7 @@ class LocationsController extends Controller
'locations.image',
'locations.currency'
])
->withCount('assignedAssets as assignedAssets_count')
->withCount('assignedAssets as assigned_assets_count')
->withCount('assets as assets_count')
->withCount('users as users_count')->findOrFail($id);
return (new LocationsTransformer)->transformLocation($location);

View file

@ -32,7 +32,7 @@ class ApiLocationsCest
$response = json_decode($I->grabResponse(), true);
// sample verify
$location = App\Models\Location::orderByDesc('created_at')
->withCount('assignedAssets as assignedAssets_count', 'assets as assets_count', 'users as users_count')
->withCount('assignedAssets as assigned_assets_count', 'assets as assets_count', 'users as users_count')
->take(10)->get()->shuffle()->first();
$I->seeResponseContainsJson($I->removeTimestamps((new LocationsTransformer)->transformLocation($location)));
}