From c4e155eebb47df6e99e748faa884aecd538028b2 Mon Sep 17 00:00:00 2001 From: Sergey Pankov Date: Thu, 18 Oct 2018 11:23:33 +0300 Subject: [PATCH] Fix case of stdClass --- database.md | 2 +- queries.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/database.md b/database.md index 62f51dffc..d295dd052 100644 --- a/database.md +++ b/database.md @@ -110,7 +110,7 @@ To run a basic query, you may use the `select` method on the `DB` facade: The first argument passed to the `select` method is the raw SQL query, while the second argument is any parameter bindings that need to be bound to the query. Typically, these are the values of the `where` clause constraints. Parameter binding provides protection against SQL injection. -The `select` method will always return an `array` of results. Each result within the array will be a PHP `StdClass` object, allowing you to access the values of the results: +The `select` method will always return an `array` of results. Each result within the array will be a PHP `stdClass` object, allowing you to access the values of the results: foreach ($users as $user) { echo $user->name; diff --git a/queries.md b/queries.md index 44a19ef72..a1f6dc051 100644 --- a/queries.md +++ b/queries.md @@ -57,7 +57,7 @@ You may use the `table` method on the `DB` facade to begin a query. The `table` } } -The `get` method returns an `Illuminate\Support\Collection` containing the results where each result is an instance of the PHP `StdClass` object. You may access each column's value by accessing the column as a property of the object: +The `get` method returns an `Illuminate\Support\Collection` containing the results where each result is an instance of the PHP `stdClass` object. You may access each column's value by accessing the column as a property of the object: foreach ($users as $user) { echo $user->name; @@ -65,7 +65,7 @@ The `get` method returns an `Illuminate\Support\Collection` containing the resul #### Retrieving A Single Row / Column From A Table -If you just need to retrieve a single row from the database table, you may use the `first` method. This method will return a single `StdClass` object: +If you just need to retrieve a single row from the database table, you may use the `first` method. This method will return a single `stdClass` object: $user = DB::table('users')->where('name', 'John')->first();