forked from miguel456/rbrecruiter
Add save & update functionality to positions
Tooltips also added, as well as a general configuration file for Mojang Status URL. Relationships were also added between forms and Vacancies. Status verification for the dashboard was moved to a Service Provider, where it adds log entries when cache expires. Authentication controllers were also updated to reflect the new dashboard URL.
This commit is contained in:
@@ -3,8 +3,45 @@
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Vacancy extends Model
|
||||
{
|
||||
//
|
||||
public $fillable = [
|
||||
|
||||
'permissionGroupName',
|
||||
'vacancyName',
|
||||
'vacancyDescription',
|
||||
'discordRoleID',
|
||||
'vacancyFormID',
|
||||
'vacancyCount',
|
||||
'vacancyStatus'
|
||||
|
||||
];
|
||||
|
||||
public function forms()
|
||||
{
|
||||
return $this->belongsTo('App\Form');
|
||||
}
|
||||
|
||||
public function open()
|
||||
{
|
||||
$this->update([
|
||||
'vacancyStatus' => 'OPEN'
|
||||
]);
|
||||
|
||||
Log::info("Vacancies: Vacancy " . $this->id . " (" . $this->vacancyName . ") opened by " . Auth::user()->name);
|
||||
}
|
||||
|
||||
public function close()
|
||||
{
|
||||
$this->update([
|
||||
'vacancyStatus' => 'CLOSED'
|
||||
]);
|
||||
|
||||
Log::warning("Vacancies: Vacancy " . $this->id . " (" . $this->vacancyName . ") closed by " . Auth::user()->name);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user