Error when to attach a file to User Model
AEK-BKF opened this issue · 5 comments
Hi,
I get this error message when I tried to attach an image to a user,
Here my code :
$avatar = $admin->attach(public_path().'/BKF/DzErpTheme/img/default-avatar.png',[
'disk' => 'media',
'title' => 'avatar',
'description' => 'default avatar',
'key' => 'avatar'.$admin->id,
]);
and here the error :
FatalThrowableError in Uuid.php line 66: Call to undefined function Bnb\Uuid\bcadd()
Please check it.
bcadd
is provided by php-bcmath
extension. You can enable the extension or use a different generator via the configuration item uuid_provider
(must be a globally available function or a static from a class in the form Name\Space\Class@method
).
Where can I enable the extension ?
I'm on ubuntu 16.04 , mariadb, php 7, Laravel 5.4
If not already installed you need to install the extension package. I presume something like php7.0-bcmath
. If the extensions is installed php7enmod bcmath
will enable it (with sudo
if not root).
Search for tutorials or howto, you'll easily find one for your system.
Maybe the dependencies should be written in the readme ? Because I also got this error in a fresh LAMP installation (and now I've installed the extension)
Thanks for reporting this. The extension dependency has been added here bnbwebexpertise/php-uuid@bab3be7
Now it should throw an error when trying to install on a PHP setup without the extension.