@@ -200,7 +200,7 @@ public function belongsTo($related, $foreignKey = null, $otherKey = null, $relat
200200 return new BelongsTo ($ query , $ this , $ foreignKey , $ otherKey , $ relation );
201201 }
202202
203- /**
203+ /**
204204 * Define a many-to-many relationship.
205205 *
206206 * @param string $related
@@ -211,8 +211,8 @@ public function belongsTo($related, $foreignKey = null, $otherKey = null, $relat
211211 * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
212212 */
213213 public function belongsToMany ($ related , $ collection = null , $ foreignKey = null , $ otherKey = null , $ relation = null )
214- {
215- // If no relationship name was passed, we will pull backtraces to get the
214+ {
215+ // If no relationship name was passed, we will pull backtraces to get the
216216 // name of the calling function. We will use that function name as the
217217 // title of this relation since that is a great convention to apply.
218218 if (is_null ($ relation ))
@@ -222,30 +222,30 @@ public function belongsToMany($related, $collection = null, $foreignKey = null,
222222 $ name = $ caller ['function ' ];
223223 }
224224
225- // First, we'll need to determine the foreign key and "other key" for the
226- // relationship. Once we have determined the keys we'll make the query
227- // instances as well as the relationship instances we need for this.
228- $ foreignKey = $ foreignKey ?: $ this ->getForeignKey () . 's ' ;
225+ // First, we'll need to determine the foreign key and "other key" for the
226+ // relationship. Once we have determined the keys we'll make the query
227+ // instances as well as the relationship instances we need for this.
228+ $ foreignKey = $ foreignKey ?: $ this ->getForeignKey () . 's ' ;
229229
230- $ instance = new $ related ;
230+ $ instance = new $ related ;
231231
232- $ otherKey = $ otherKey ?: $ instance ->getForeignKey () . 's ' ;
232+ $ otherKey = $ otherKey ?: $ instance ->getForeignKey () . 's ' ;
233233
234- // If no table name was provided, we can guess it by concatenating the two
235- // models using underscores in alphabetical order. The two model names
236- // are transformed to snake case from their default CamelCase also.
237- if (is_null ($ collection ))
238- {
239- $ collection = $ instance ->getTable ();
240- }
234+ // If no table name was provided, we can guess it by concatenating the two
235+ // models using underscores in alphabetical order. The two model names
236+ // are transformed to snake case from their default CamelCase also.
237+ if (is_null ($ collection ))
238+ {
239+ $ collection = $ instance ->getTable ();
240+ }
241241
242- // Now we're ready to create a new query builder for the related model and
243- // the relationship instances for the relation. The relations will set
244- // appropriate query constraint and entirely manages the hydrations.
245- $ query = $ instance ->newQuery ();
242+ // Now we're ready to create a new query builder for the related model and
243+ // the relationship instances for the relation. The relations will set
244+ // appropriate query constraint and entirely manages the hydrations.
245+ $ query = $ instance ->newQuery ();
246246
247- return new BelongsToMany ($ query , $ this , $ collection , $ foreignKey , $ otherKey , $ relation );
248- }
247+ return new BelongsToMany ($ query , $ this , $ collection , $ foreignKey , $ otherKey , $ relation );
248+ }
249249
250250 /**
251251 * Get a new query builder instance for the connection.
0 commit comments