Model Functions in Laravel Files located under app/ModelName
protected $fillable = ['title', 'body']; //Allowed Fields
protected $guarded = ['id']; //Not Allowed Fields
public function scopeCompleted($query)
{
return $query->where('completedField', 1);
}
public function scopeIncomplete ($query)
{
return $query->where('completedField', 0);
}
public function scopeAll($query)
{
return $query->all();
}