forked from miguel456/rbrecruiter
Add user invitation facilities RSM-5
Adds user invitation to teams, and framework for assigning taems Also adds user acc. deletion.
This commit is contained in:
35
app/Services/VacancyApplicationService.php
Normal file
35
app/Services/VacancyApplicationService.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Vacancy;
|
||||
use App\Application;
|
||||
|
||||
class VacancyApplicationService
|
||||
{
|
||||
|
||||
/**
|
||||
* Finds all applications associated with $model.
|
||||
*
|
||||
* @param Vacancy $model The model you want to search through.
|
||||
* @return Illuminate\Support\Collection A collection of applications
|
||||
*/
|
||||
public function findApplications(Vacancy $model)
|
||||
{
|
||||
|
||||
$applications = collect([]);
|
||||
|
||||
foreach(Application::all() as $application)
|
||||
{
|
||||
if ($application->response->vacancy->id == $model->id)
|
||||
{
|
||||
$applications->push($application);
|
||||
}
|
||||
}
|
||||
|
||||
return $applications;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user