mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-01 12:43:46 +01: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 @@ public function getIconAttribute($value)
|
|||||||
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…
Reference in New Issue
Block a user