Created
March 4, 2015 04:06
-
-
Save ryanmr/11d5fb1651143b00ddcc to your computer and use it in GitHub Desktop.
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
public function scopeVisible($query) { | |
return $query | |
->where('hidden', '=', false) | |
->where('state', '=', 'published'); | |
} | |
public function scopeAccessible($query) { | |
return $query | |
->where('hidden', '=', false) | |
->where(function($query){ | |
$query | |
->where('state', '=', 'preview') | |
->orWhere('state', '=', 'published'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment