2020-04-29 17:15:54 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class Appointment extends Model
|
|
|
|
{
|
2020-05-22 02:49:16 +00:00
|
|
|
public $fillable = [
|
2020-09-02 23:23:09 +00:00
|
|
|
'appointmentDescription',
|
|
|
|
'appointmentDate',
|
|
|
|
'applicationID',
|
2020-05-22 02:49:16 +00:00
|
|
|
'appointmentStatus',
|
2020-09-02 23:23:09 +00:00
|
|
|
'appointmentLocation',
|
|
|
|
'meetingNotes',
|
2020-10-21 00:29:50 +00:00
|
|
|
'userAccepted'
|
2020-05-22 02:49:16 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
public function application()
|
|
|
|
{
|
2020-10-21 00:29:50 +00:00
|
|
|
// FIXME: Possible bug here, where laravel looks for the wrong column in the applications table.
|
2020-05-22 02:49:16 +00:00
|
|
|
return $this->belongsTo('App\Application', 'id', 'applicationID');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setStatus($status)
|
|
|
|
{
|
|
|
|
$this->update([
|
2020-10-21 00:29:50 +00:00
|
|
|
'appointmentStatus' => $status
|
2020-05-22 02:49:16 +00:00
|
|
|
]);
|
|
|
|
}
|
2020-04-29 17:15:54 +00:00
|
|
|
}
|