Fixed free_seats_count variable name

(I forgot that Laravel switched camel case to snake case for their old 5.4 withCount variables)
This commit is contained in:
snipe 2019-05-24 15:44:18 -07:00
parent 78fb2b2239
commit d596ced0a0
2 changed files with 2 additions and 2 deletions

View file

@ -25,7 +25,7 @@ class LicensesController extends Controller
public function index(Request $request) public function index(Request $request)
{ {
$this->authorize('view', License::class); $this->authorize('view', License::class);
$licenses = Company::scopeCompanyables(License::with('company', 'manufacturer', 'freeSeats', 'supplier','category')->withCount('freeSeats as freeSeats_count')); $licenses = Company::scopeCompanyables(License::with('company', 'manufacturer', 'freeSeats', 'supplier','category')->withCount('freeSeats as free_seats_count'));
if ($request->filled('company_id')) { if ($request->filled('company_id')) {

View file

@ -31,7 +31,7 @@ class ApiLicensesCest
$response = json_decode($I->grabResponse(), true); $response = json_decode($I->grabResponse(), true);
// sample verify // sample verify
$license = App\Models\License::orderByDesc('created_at') $license = App\Models\License::orderByDesc('created_at')
->withCount('freeSeats as freeSeats_count') ->withCount('freeSeats as free_seats_count')
->take(10)->get()->shuffle()->first(); ->take(10)->get()->shuffle()->first();
$I->seeResponseContainsJson($I->removeTimestamps((new LicensesTransformer)->transformLicense($license))); $I->seeResponseContainsJson($I->removeTimestamps((new LicensesTransformer)->transformLicense($license)));
} }