deploy commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
class Account extends Authenticatable
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\AccountFactory> */
|
||||
use HasApiTokens, HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'phone',
|
||||
'dob',
|
||||
'role',
|
||||
'password',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'password' => 'hashed',
|
||||
'role' => 'string', // patient or doctor
|
||||
];
|
||||
}
|
||||
|
||||
public function submission()
|
||||
{
|
||||
return $this->hasMany(Submission::class, 'patient_id');
|
||||
}
|
||||
|
||||
public function doctorProfile() {
|
||||
return $this->hasOne(DoctorProfile::class, 'user_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DoctorProfile extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\DoctorProfileFactory> */
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'specialization',
|
||||
'license_number',
|
||||
'license_file_path',
|
||||
'diploma_file_path',
|
||||
'certification_file_path',
|
||||
'current_institution',
|
||||
'work_history',
|
||||
'publications',
|
||||
'practice_address'
|
||||
];
|
||||
|
||||
public function account() {
|
||||
return $this->hasOne(Account::class, 'user_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\SubmissionFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Submission extends Model
|
||||
{
|
||||
/** @use HasFactory<SubmissionFactory> */
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'patient_id',
|
||||
'doctor_id',
|
||||
'image_path',
|
||||
'complaint',
|
||||
'status',
|
||||
'diagnosis',
|
||||
'doctor_note',
|
||||
'submitted_at',
|
||||
'verified_at',
|
||||
'percentage',
|
||||
'is_submitted',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'submitted_at' => 'datetime',
|
||||
'verified_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function scopePending($q) { return $q->where('status','pending'); }
|
||||
public function scopeHistory($q) { return $q->where('status','!=','pending'); }
|
||||
|
||||
public function patient()
|
||||
{
|
||||
return $this->belongsTo(Account::class, 'patient_id');
|
||||
}
|
||||
public function doctor() {
|
||||
return $this->belongsTo(Account::class, 'doctor_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||
use HasApiTokens, HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Verification extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\VerificationFactory> */
|
||||
use HasFactory;
|
||||
}
|
||||
Reference in New Issue
Block a user