Image for post
Image for post
Using PHP8 with Docker

If you want to try the new release of PHP 8 and you want to install it on your local machine without having side effects on your current PHP projects and your current PHP 7 stack, I have some suggestion for you.

I think that the safest and quickest way to install and use PHP 8 is running PHP in an isolated environment. To achieve that, you can use a Docker image with all things needed by PHP runtime avoiding negative impact or conflicts with your current local PHP 7 installation.

In this tutorial I’m going to use my custom docker image robertobutti/php8-alpine-cli:php8.0.0 . As soon as it will be published a PHP 8 official image on https://hub.docker.com/_/php?tab=tags&page=1&ordering=last_updated I will update the tutorial using the official image. …


Image for post
Image for post
Using ref() or reactive() — Vue3

In my previous post, I implemented my first Vue3 component.

I implementend a very simple web app (roll the dice) where I had a “div” where to show the result and a button to trigger the roll and generate a random number from 1 to 6.

In that case, I used “ref()” to create reactive properties.

“My first Vue3 component” article where I used ref() for declaring reactive properties: https://medium.com/swlh/my-first-vue3-component-6e1ef1670544

The ref() “approach”

For example in “setup()” function of my component I declared “dice” property in order to store the last result of the roll action.


Image for post
Image for post
My first Vue3 component: vite, composition API, ref(), computed(), setup()

I like to work with Vuejs, and today I tried to use the next version of Vuejs: Vue3.

My first question was: how can I create a new Web Application with Vue3 and the right npm dependencies?

To do that, I used Vite as build tool. Vite is an amazing web dev build tool that serves your code via native ES Module imports during dev and bundles it with Rollup for production. Vite uses Vue3. So if we use Vite we have an amazing fast build tool and we have all vue3 dependencies ready to use.

Install the skeleton for Vue 3

In order to install Vite and your sample application based on…


Image for post
Image for post

GitHub Actions ( https://github.com/features/actions) is a powerful service provided by GitHub for continuous integration and continuous delivery.

GitHub Actions allows you to execute some commands when a GitHub event is triggered. For example you can automate the execution of unit tests on your code base when you push your code in the repository.

With GitHub Actions you can:

  • setup your runner or container (with your stack: database, compilers, executables, web server…);
  • fetch your code from the repository and store in you running container;
  • setup your additional services like MySQL database;
  • configure your application (configure the database connection, generate all needed keys, warmup the cache, fix…

Image for post
Image for post
LaraLens: Laravel artisan command to inspect configuration and runtime parameters

LaraLens is a Laravel Artisan Command to show you the current configuration of your application. It is useful to show in your terminal the status of:

  • some useful configuration variable;
  • the connection to the database;
  • the tables in the database;
  • the connection via HTTP request.

Why?


Creating a workflow for GitHub Action is quite easy. You need to understand how the “GitHub Workflow” process works and then you need to create a Yaml file to define your workflow configuration.

You could start from:

So, once you are able to start to write your workflow Yaml file, probably you would need a support in your editor, while you are creating/editing your Yaml file. A good support from your editor would be: suggest and show some directive description while you are typing and check the syntax and notify you if you are doing some error (typo, wrong directive etc). …


With Github actions you can automate some specific tasks and you can execute them on a dedicated environment.

Suppose that you have a Laravel application on a Github repository and you want to execute the test suite (via phpunit) every time you push your code on master branch.

From the Github repository page, click on “Actions”.

Image for post
Image for post
Actions tab

On Actions section you can create and manage your workflow.

A workflow is a set of steps that it will be execute once you perform a specific action on your repository, for example push your code on master branch.

To create a new workflow, in the action section, click on the “New workflow” button. …


With this post I will show you how to implement a command line interface to report and retrieve weather forecast in a specific location.

To achieve this, I will use:

What we are going to do:

  • Obtain a valid API KEY from HERE Developer portal
  • Create a new Laravel project
  • Write the custom command
  • Test the new command

The user story could be:

As user I can launch a command “php artisan weather:forecast Venice”, so that I can see a list of an hour-by-hour seven day weather forecast. …


In the lasts weeks I worked with Maps and React, I learnt Typescript, and I took a look in the latest version of HERE Maps Javascript (3.1).

So, I decided to mix all together, write a small side project and write some notes about my experiment about mixing 3D map, React, Typescript.

Image for post
Image for post
3D Map, React, Typescript

The goal is to highlight some not obvious steps when you need to mix together all these things.
The steps will be:

  • Create a empty project with “Create React App” with Typescript enabled;
  • Creating a React Component for the Map;
  • Storing and using the API KEY for the…

GitHub Actions (https://github.com/features/actions) is a powerful tool provided by GitHub for continuous integration.

I just published an updated article for Laravel 7 + MySQL + managing secrets with GitHub Actions: https://medium.com/swlh/test-automation-for-laravel-7-and-mysql-with-github-actions-467493c2f7ed

GitHub Actions allows you to execute some commands when a GitHub event is triggered. For example you can automate the execution of unit test of your code when you push your code in the repository.

GitHub Actions provide you an environment where you can setup the technology stack, fetch your code from the repository, configure your software and execute some command.

The scenario that I would like to explain you…

About

Roberto Butti

I’m technophile. Vuejs and Laravel enthusiast! #vuejs #laravel. I love #coding

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store