Added Sanctum + new options to seeder
This commit is contained in:
@@ -33,6 +33,11 @@ class Application extends Model
|
||||
|
||||
];
|
||||
|
||||
public function oneoffApplicant()
|
||||
{
|
||||
return $this->hasOne('App\OneoffApplicant', 'application_id', 'id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\User', 'applicantUserID', 'id');
|
||||
@@ -64,4 +69,12 @@ class Application extends Model
|
||||
'applicationStatus' => $status,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function isOneoff()
|
||||
{
|
||||
return $this->user->id == 1; // ID 1 is always the ghost
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
17
app/OneoffApplicant.php
Normal file
17
app/OneoffApplicant.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OneoffApplicant extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public function application()
|
||||
{
|
||||
return $this->belongsTo('App\Application', 'id', 'application_id');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user