src/package/Data/Repositories/Support/Helpers.php
protected function encodeFile($file)
    {
        $type = pathinfo($file, PATHINFO_EXTENSION);

        $data = file_get_contents($file);

        if ($type == 'html') {
            return $data;
        }

        return 'data:image/'.$type.';base64,'.base64_encode($data);
    }
protected function encodeFile($file)
    {
        $type = pathinfo($file, PATHINFO_EXTENSION);

        $data = file_get_contents($file);

        if ($type == 'html') {
            return $data;
        }

        return 'data:image/'.$type.';base64,'.base64_encode($data);
    }
protected function encodeFile ( $ file ) { $ type = pathinfo ( $ file , PATHINFO_EXTENSION ) ; $ data = file_get_contents ( $ file ) ; if ( $ type == 'html' ) { return $ data ; } return 'data:image/' . $ type . ';base64,' . base64_encode ( $ data ) ; }
Encode a image or html for database storage.

@param $file

@return bool|mixed|string
Encode a image or html for database storage .