Skip to content

Commit

Permalink
[TM-1474] add scope approved to site reports
Browse files Browse the repository at this point in the history
  • Loading branch information
LimberHope committed Nov 22, 2024
1 parent 71beb05 commit 0655b5d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Models/V2/Sites/SiteReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use App\Models\V2\TreeSpecies\TreeSpecies;
use App\Models\V2\User;
use App\Models\V2\Workdays\Workday;
use App\StateMachines\ReportStatusStateMachine;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
Expand Down Expand Up @@ -398,4 +399,9 @@ public static function search($query)
->orWhere('organisations.name', 'like', "%$query%")
->orWhere('v2_sites.name', 'like', "%$query%");
}

public function scopeApproved($query)
{
return $query->where('status', ReportStatusStateMachine::APPROVED);
}
}

0 comments on commit 0655b5d

Please sign in to comment.