mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-01 20:47:32 +00:00
1.7 - Testing Query Scopes
This commit is contained in:
@@ -9,6 +9,11 @@ class Concert extends Model
|
||||
protected $guarded = [];
|
||||
protected $dates = ['date'];
|
||||
|
||||
public function scopePublished($query)
|
||||
{
|
||||
return $query->whereNotNull('published_at');
|
||||
}
|
||||
|
||||
public function getFormattedDateAttribute()
|
||||
{
|
||||
return $this->date->format('F j, Y');
|
||||
|
||||
Reference in New Issue
Block a user