Advertisement
emilmoe

Untitled

May 17th, 2020
1,202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. /**
  2.  * Selected active event for given date.
  3.  *
  4.  * @param  Carbon $date
  5.  * @return Event
  6.  */
  7. public static function active(Carbon $date): Event
  8. {
  9.     return self::where('locked_active', true)->count() > 0
  10.         ? self::where('locked_active', true)->firstOrFail()
  11.         : self::where('date', $date)->firstOrFail();
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement