Created
March 5, 2016 05:57
-
-
Save vinicius73/76a37e43e187f43b6aac to your computer and use it in GitHub Desktop.
UsersRepository extends BaseRepository
This file contains hidden or 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 | |
namespace App\Domains\Users; | |
use App\Support\Repositories\BaseRepository; | |
use Carbon\Carbon; | |
class UsersRepository extends BaseRepository | |
{ | |
protected $modelClass = User::class; | |
public function getPaying($limit = 15, $paginate = true) | |
{ | |
$now = Carbon::now(); | |
$query = $this->newQuery(); | |
$query->where('is_subscriber', true); | |
$query->where('subscription_ends_in', '<=', $now); | |
$query->orderBy('name'); | |
return $this->doQuery($query, $limit, $paginate); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment