Created
March 13, 2019 19:05
-
-
Save lomotech/0433ef6c6b225bbeffb052b032065274 to your computer and use it in GitHub Desktop.
repository problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public static function getAll() | |
{ | |
return Cache::remember('status:all', 60, function () { | |
return Status::all(); | |
}); | |
} | |
/** | |
* @param $category_id | |
* @return mixed | |
*/ | |
public static function getByCategory($category_id = null) | |
{ | |
$statuses = StatusRepository::getAll(); | |
if ($category_id != null) { | |
$statuses->where('category_id', $category_id); | |
} | |
return $statuses; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment