viblo.asia viblo.asia

An Object that behaves like an Array in PHP

In this post, I want to introduce a rarely used feature in PHP which allows our PHP objects to have the behaviors of an array. That is possible by making a class to implement the ArrayAccess interface. In fact, this feature can be seen quite often in many PHP frameworks, especially Laravel. Before getting into the details of this feature, let's review our very basic knowledge about PHP objects and arrays. 1. Array To create an array,...

viblo.asia viblo.asia

PHP Laravel: Getting started

1. Introduction The best way to start learning a new programming language or a framwork is building a simple application. In this post, I'm gonna walk you through some simple steps to create a TodoList application using Laravel framework. The laravel version that I'm using at the time writing this post is Laravel 6. 2. Implementation I assumed that you already have mysql database and the lastest Composer installed on your machine, if...