staffmanager/app/Vacancy.php
Miguel Nogueira 4c6a435e34 Entrypoint: Add Application Page
This commit finally adds the dynamically rendered form that changes according to how the user builds their form.
It also fragments the header and footer for the main page into their own separate files for ease of access later.
Vacancy status has also been added to the Vacancies in DB.
All staff application endpoints have also been moved to under the user application endpoints group, for ease of use (duplicated route group).
2020-05-08 06:06:24 +01:00

49 lines
994 B
PHP

<?php
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',
'vacancySlug'
];
public function forms()
{
return $this->belongsTo('App\Form', 'vacancyFormID', 'id');
}
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);
}
}