Have you ever challenged the task to generate default avatars similar as gmail does? If yes, then I could guess that you used some HTML/CSS/JS solution.

In this article I would like to tell how to generate gmail avatars (or other avatars) with PHP. So, just a back-end solution!

At first! You don’t need to create your own bicycle!
The one is created already, please check this composer package:

gmail-logo/generator”.

This package allows you to generate images like this:

--

--

Laradock (https://laradock.io/) is popular way of general Docker configuration for web applications. Although Laradock has wide settings, some packages are not easy to configure..

Xdebug is a popular PHP debugger. To know more about the debugger, please check this link: https://xdebug.org/

To configure Xdebug on Laradock you need to pass such steps:

1) Go to .env file in Laradock and set WORKSPACE_INSTALL_XDEBUG, PHP_FPM_INSTALL_XDEBUG equal TRUE!
2) Go to laradock/php-fpm folder and edit file “xdebug.ini”. In this file you need to set xdebug.remote_host=”172.17.0.1".
3) Go to laradock/workspace folder and edit file “xdebug.ini”. In this file you need to set xdebug.remote_host=”172.17.0.1".

Build and restart laradock:
* docker-compose build -no-cache php-fpm
* docker-compose build -no-cache workspace
* docker-compose up -d

--

--

Alexey Fedorchak

Alexey Fedorchak

Hi! I’m expert certified Laravel/PHP developer.