PHP

Secure your project with the GitLab SAST analyzers

Learn how to secure any project with the GitLab SAST analyzers and easily separate the false positives from the real threats that should be addressed before deploying the project.

Read more
Laravel database transactions & mysqldump

Did you know that mysqldump can create inconsistent backups if you do not use database transactions in Laravel? Let's discover that issue and address it in order to avoid it. After setting up and running locally a Laravel project that will serve as a demo for that specific issue, we will observe the necessity of using transactions and how to implement them. We'll also discover many more tips while trying to understand what happens under the MySQL hood.

Read more
Detect unnecessary 'use' statements with PHP CodeSniffer

PHP Code Sniffer is a great tool to make sure your code is nicely written. Next to the default rules, you can also install and use additional rules (sniffs) to further enhance your code. Is here how to use PHPCS to detect (and remove) all unnecessary 'use' statements in your code.

Read more
Testing with Selenium and PHPUnit

In this blog post we continue our series about testing a web application with Selenium. This time we will show how to integrate Selenium with PHPUnit tests and assertions.

Read more
Laravel Custom Logging

For the majority of developed program, it is necessary to use a robust and efficient Log mechanism. It is of course the case for a web interface. It is important to be able to track potential bugs or issues.

Read more
Implementing email verification in Laravel

Have you ever wanted to ensure your users use email addresses they actually possess? Here is a quick way to achieve it. This tutorial assumes that you already have:

Read more
Automated web application testing with PHP, Selenium and GitLab

The easiest way to test that a web application is working correctly is to use a browser and manually go through the pages. If one wants to automate the testing process, there are conceptually two possible approaches: 1) using raw HTTP requests to simulate a browser or 2) using some library and code to drive an actual browser.

Read more
Run your Laravel app with docker-compose

Docker-compose is an elegant way to run a Laravel app. It allows to define and run the different services: the main web app, a MySQL database and a redis server. There are however a few tricks to solve: how to run the database migrations, how to run the queue worker and the scheduler?

Read more
Laravel migrations tips

When developing a Laravel application, it's quite common to run the development (and test) version with a SQLite database, and the production version with a MySQL database. Normally, the migrations will take care of creating the correct database schema. However, there are a few caveats.

Read more
Check your PHP dependencies for vulnerabilities

Enlightn Security Checker is a composer tool that uses the Security Advisories Database to check your dependencies for known vulnerabilities. It is actually the same database that is used by GitHub Action "PHP Security Checker". Here is how you can use it locally or with GitLab.

Read more
Using HTTPS over a reverse proxy in Laravel

Have you ever encountered problems trying to deploy a Laravel HTTPS website using a reverse proxy ? Then read the following to quickly learn where this problem comes from and how to simply thwart it.

Read more
Continuous Deployment with GitLab and Laravel Envoy

There are multiple ways to implement Continuous Deployment (CD) for a Laravel project. The current trends consists in deploying containers to a kubernetes cluster. In this blog post however, we will present the good old way: we will use Laravel Envoy to deploy our code directly to our server(s). This method has the advantage of simplicity as it does not require to build containers, nor does it require a kubernetes cluster: Laravel Envoy uses a simple SSH connection to the target server(s) to perform the deployment.

Read more