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:
committed by
nurafrinaalimi16
parent
8bde7a0544
commit
1d892b064e
+15
-5
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user