mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-19 19:28:08 +02:00
Blank icon property if icon file is missing during store/update
This commit is contained in:
parent
c948bc5f24
commit
f2dbf3f1e2
@ -52,6 +52,28 @@ class TwoFAccount extends Model
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prevent setting a missing icon
|
||||||
|
*
|
||||||
|
* @param string $value
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function setIconAttribute($value)
|
||||||
|
{
|
||||||
|
|
||||||
|
if( !Storage::exists('public/icons/' . pathinfo($value)['basename']) ) {
|
||||||
|
|
||||||
|
$this->attributes['icon'] = '';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
$this->attributes['icon'] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the account type.
|
* Get the account type.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user