Skip to content

Commit

Permalink
Fixed more camel-casing -> snake-casing
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed May 24, 2019
1 parent d5c3ee5 commit 56576d9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/SyncAssetCounters.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct()
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) {
Expand Down
2 changes: 1 addition & 1 deletion app/Helpers/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public static function generateRandomString($length = 10)
*/
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();

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/LocationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function index(Request $request)
'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');

Expand Down Expand Up @@ -123,7 +123,7 @@ public function show($id)
'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);
Expand Down
2 changes: 1 addition & 1 deletion tests/api/ApiLocationsCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function indexLocations(ApiTester $I)
$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)));
}
Expand Down

0 comments on commit 56576d9

Please sign in to comment.