Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed May 10, 2018
1 parent 27b1652 commit 4002b71
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected function loadMissingRelation(Collection $models, array $path)
// Handle *-many relationships.
if ($models->first() instanceof BaseCollection) {
$models = $models->collapse();
};
}

// Load the remaining path.
$this->loadMissingRelation(new static($models), $path);
Expand Down
12 changes: 8 additions & 4 deletions tests/Integration/Database/EloquentCollectionLoadMissingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ class Comment extends Model

protected $guarded = ['id'];

public function parent() {
public function parent()
{
return $this->belongsTo(Comment::class);
}

public function revisions() {
public function revisions()
{
return $this->hasMany(Revision::class);
}
}
Expand All @@ -82,11 +84,13 @@ class Post extends Model

protected $guarded = ['id'];

public function comments() {
public function comments()
{
return $this->hasMany(Comment::class);
}

public function user() {
public function user()
{
return $this->belongsTo(User::class);
}
}
Expand Down
6 changes: 4 additions & 2 deletions tests/Integration/Database/EloquentModelLoadMissingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class Comment extends Model

protected $guarded = ['id'];

public function parent() {
public function parent()
{
return $this->belongsTo(Comment::class);
}
}
Expand All @@ -60,7 +61,8 @@ class Post extends Model
{
public $timestamps = false;

public function comments() {
public function comments()
{
return $this->hasMany(Comment::class);
}
}

0 comments on commit 4002b71

Please sign in to comment.