Skip to content

Commit

Permalink
Updated the post scopes to use the Status object consts rather than h…
Browse files Browse the repository at this point in the history
…ard coded integers (#52)
  • Loading branch information
moebrowne authored and nWidart committed Jun 1, 2017
1 parent bd3dcf1 commit 68b7ecd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Entities/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function getThumbnailAttribute()
*/
public function scopeDraft(Builder $query)
{
return $query->whereStatus(0);
return $query->whereStatus(Status::DRAFT);
}

/**
Expand All @@ -64,7 +64,7 @@ public function scopeDraft(Builder $query)
*/
public function scopePending(Builder $query)
{
return $query->whereStatus(1);
return $query->whereStatus(Status::PENDING);
}

/**
Expand All @@ -74,7 +74,7 @@ public function scopePending(Builder $query)
*/
public function scopePublished(Builder $query)
{
return $query->whereStatus(2);
return $query->whereStatus(Status::PUBLISHED);
}

/**
Expand All @@ -84,7 +84,7 @@ public function scopePublished(Builder $query)
*/
public function scopeUnpublished(Builder $query)
{
return $query->whereStatus(3);
return $query->whereStatus(Status::UNPUBLISHED);
}

/**
Expand Down

0 comments on commit 68b7ecd

Please sign in to comment.