Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function scopeJoinedToday($query)
- {
- return $query->where('role', 3)->whereBetween('created_at', [Carbon::now()->format('Y-m-d').' 00:00:00' , Carbon::now()->format('Y-m-d').' 23:59:59'] );
- }
- public function scopeJoinedThisWeek($query)
- {
- return $query->where('role', 3)->whereBetween('created_at', [ Carbon::now()->addDays(-7)->format('Y-m-d').' 00:00:00' , Carbon::now()->format('Y-m-d').' 23:59:59'] );
- }
- public function scopeJoinedLastMonth($query)
- {
- return $query->where('role', 3)->whereBetween('created_at', [ Carbon::now()->addMonths(-1)->format('Y-m-d').' 00:00:00' , Carbon::now()->format('Y-m-d').' 23:59:59'] );
- }
- public function scopeJoinedThreeMonthsAgo($query)
- {
- return $query->where('role', 3)->whereBetween('created_at', [ Carbon::now()->addMonths(-6)->format('Y-m-d').' 00:00:00' , Carbon::now()->addMonths(-3)->format('Y-m-d').' 23:59:59'] );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement