Added services
This commit moves most controller logic onto Services. Services are part of the Service-Repository pattern. The models act as repositories. Services are easily testable and are needed for the upcoming API, in order to avoid duplicated code and to maintain a single source of "truth". The User, Vacancy and Vote controllers still need their logic moved onto services.
This commit is contained in:
@@ -27,6 +27,8 @@ use App\Vacancy;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
// Note: The dashboard doesn't need a service because it doesn't contain any significant business logic
|
||||
|
||||
public function index()
|
||||
{
|
||||
$totalPeerReview = Application::where('applicationStatus', 'STAGE_PEERAPPROVAL')->get()->count();
|
||||
|
Reference in New Issue
Block a user