Add and fix nominee profile photo uploads

- Run artisan migrate to add column photo in nominee table
- npm run development/watch
This commit is contained in:
Afiq Hamzah
2024-03-23 23:01:43 +08:00
committed by nurafrinaalimi16
parent 8bde7a0544
commit 1d892b064e
8 changed files with 196 additions and 66 deletions
+15 -5
View File
@@ -8,14 +8,24 @@ class Nominee extends Model
{
protected $table = 'nominee';
protected $fillable = [
'name',
'unit',
'no_anggota',
'name',
'unit',
'no_anggota',
'position_id',
'partylist_id',
'election_id',
'image',
'description',
'motto'
'motto',
'photo',
];
public $timestamp = false;
public function getPhotoAttribute($value)
{
if ($value) {
return base64_encode($value);
}
return null;
}
}