Array Validation in Laravel 4

Introduction

At work we are still using Laravel 4 for a few projects. From time to time we need to validate an array of form fields using the Laravel Validator, however before Laravel 5.2 this was not a trivial task. Let’s break down the problem a little bit.

Suppose that you want to validate a form that uses dynamic fields, added at run time by the user. Take the example of a product in an ecommerce website. We need to insert some information on a product, let’s say …

Read More
Basic ProcessWire website workflow - Part Four

Introduction

Following Part 1, Part 2 and Part 3.

In this post we will make the final touches and personalizations to our website. Let’s see what are going to do:

  • Implement a basic Sitemap
  • Implement ProcessWire Roles and Permissions
  • Tweak CKEditor a little bit
  • Implement a little countermeasure to avoid bots to read emails
  • Implement the Facebook plugin
  • Add the cookie notification

Also this post concludes this series on ProcessWire, but don’t worry, I’m planning …

Read More
Easily impersonate any user in a Laravel Application

Introduction

Impersonate is quite a handy feature in some applications. It allows you to choose from a list of users and to impersonate them, in order to see the application from their point of view, without having to log out and log in again. For example, as an administrator you want to recreate a bug encountered by one of your users, without having them to share their password with you.

It’s a functionality that it’s really powerful, but at the same time it’s …

Read More
Basic ProcessWire website workflow - Part Three

Introduction

Following Part 1 and Part 2.

In this Post we will look on how to implement the PW modules introduced in Part 1. Let’s recap them:

  • MarkupSimpleNavigation: to generate the main navigation menu
  • AIOM: to concatenate, minify and cache our assets
  • MarkupSEO: the SEO solution for PW
  • MarkupGoogleMap: to embed a Google Map on your pages
  • ProcessSlider: to create image sliders for your pages
  • ProcessHannaCode: to insert any complex HTML, Javascript or PHP output in your …
Read More
Basic ProcessWire website workflow - Part Two

Introduction

Following the Part One.

In the previous article we have set the foundations, now it’s time to actually code the pages our basic website.

Template Inheritance

Let’s start by explaining the concept of template inheritance. The Smarty documentation provides a nice explanation of this approach, which allows the developer/designer to compose each page by writing only the necessary code and inheriting or including the common parts that are shared. …

Read More
Test Laravel filesystem storage with Virtual File System

Introduction

Since Laravel 5, the filesystem operations are abstracted thanks to the Flysystem PHP package by Frank de Jonge. This integration provides simple drivers for working with local filesystems, Amazon S3, and other Cloud Storage. The API remains the same for each system therefore is really simple to swap between each storage option.

Testing the filesystem is not an easy task. I covered some of the challenges in a previous blog post, but luckily we have a couple of tools …

Read More