Skip to content

Commit

Permalink
return results for getByModelType
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Aug 13, 2015
1 parent 8004248 commit 7065619
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All Notable changes to `laravel-medialibrary` will be documented in this file

##3.1.3
- Fixed a bug where getByModelType would return null

##3.1.2
- Images and pdf with capitalized extensions will now be recognized

Expand Down
3 changes: 2 additions & 1 deletion src/MediaRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ public function all()
* Get all media for the given type.
*
* @param string $modelType
* @return \Illuminate\Database\Eloquent\Collection
*/
public function getByModelType($modelType)
{
$this->model->where('model_type', $modelType)->get();
return $this->model->where('model_type', $modelType)->get();
}

/**
Expand Down

0 comments on commit 7065619

Please sign in to comment.