php base



How to create a Composer package from scratch

Available to Premium members only
  • avatar
  • 1.7K Views
  • 1 Like
  • 16 mins read
How to create a Composer package from scratch

A helper class, a small client wrapper or a set of validation rules often starts in one project and ends up copied into the next one. From that point the copies drift apart, a bug fixed in one of them stays open in the rest, and there is no version number to refer to when something changes.

Turning that code into a Composer package removes the copies. The requirements are modest, since a package is a directory containing a valid composer.json file, a Git repository hosting it, and a listing on Packagist that tells Composer where to find it.

Create Laravel 13 project from scratch

  • avatar
  • 1.7K Views
  • 7 mins read
Create Laravel 13 project from scratch

Laravel is a PHP framework built around the Model View Controller pattern, designed to make web development more organized and less repetitive. It has become one of the most widely used frameworks in the PHP ecosystem, and its yearly major releases keep bringing refinements to routing, database handling, testing, and application structure. Laravel 13 continues that pattern with a required PHP version bump, additional PHP attributes for controllers and queues, and a first party AI SDK, while leaving most day to day development patterns unchanged. Creating a new Laravel 13 project begins with installing PHP, Composer, and Laravel itself, followed by a short round of configuration that prepares the application for development.

How to install & start using Composer

  • avatar
  • 3.3K Views
  • 2 mins read
How to install & start using Composer

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

Composer requires PHP 5.3.2+ to run. A few sensitive PHP settings and compile flags are also required, but when using the installer you will be warned about any incompatibilities.

 Join Our Monthly Newsletter

Get the latest news and popular articles to your inbox every month

We never send SPAM nor unsolicited emails

How to track online users with Redis

  • avatar
  • 1.2K Views
  • 11 mins read
How to track online users with Redis

The number of people using a website right now is a common metric. It shows how active the site is at a given moment, and it makes traffic visible while it happens instead of after the fact. Analytics services can report it, but with a delay and outside the application. Redis can keep it inside your own code: each page view records the visitor, and the count is read for the last X minutes, where X is a value from the configuration file that can be changed at any time.

The internet is having a very bad cybersecurity week

  • 548 Views
  • 1 Like
  • 4 mins read
The internet is having a very bad cybersecurity week

Within a single day, several unrelated security problems came to light and kept security teams occupied. PHP disclosed two critical remote code execution flaws, Node.js released a security update fixing four high-severity issues, a malicious LiteLLM version showed up in public package and container registries, and an Indian certificate authority was found to have eight intermediate keys that anyone could guess. Every one of these problems affects a different layer of the stack, and seeing them together shows how many points of exposure a single server or container image can have at once.

HyperLogLog for counting unique elements with fixed memory

  • avatar
  • 309 Views
  • 12 mins read
HyperLogLog for counting unique elements with fixed memory

Counting unique visitors sounds like a small task until the numbers grow. Every distinct ID has to be remembered, every new visit needs a check against the ones already seen and memory keeps rising with each new person. HyperLogLog is an algorithm that skips the remembering. It estimates how many different items went through a stream while keeping a few kilobytes of state and in return it accepts a small error that can be measured in advance.