Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Laravel Eager Loading - Case Sensitive ##
- # 1. Attempt with Capitalized Letter #
- \DB::enableQueryLog();
- $invoice = Invoices::with('Client')->first();
- echo $invoice->Client->name
- $queries = \DB::getQueryLog();
- dd($invoice);
- #### Returns 2 queries executed ####
- # 2. Attempt with non capitalized Letter #
- \DB::enableQueryLog();
- $invoice = Invoices::with('Client')->first();
- echo $invoice->client->name
- $queries = \DB::getQueryLog();
- dd($invoice);
- #### Returns 3 queries executed ####
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement