The Factory Design Pattern

By Michael Williams, Published on 03/20/2016

In object-oriented programming (OOP), a factory is an object for creating other objects – formally a factory is a function or method that returns objects of a varying prototype or class[1] from some method call, which is assumed to be "new". Wikipedia

The Adapter Design Pattern

By Michael Williams, Published on 03/12/2016

In software engineering, the adapter pattern is a software design pattern that allows the interface of an existing class to be used from another interface. It is often used to make existing classes work with others without modifying their source code. Wikipedia

<?php
class Paypal
{
public function processPayment($amount)
{
// Processes payment with Paypal
echo "Payment processed for $amount";
}
}

$paypal = new Paypal();
$paypal->processPayment(100);
Design Patterns

By Michael Williams, Published on 03/12/2016

In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design.

A design pattern is not a finished design that can be transformed directly into source or machine code. It is a description or template for how to solve a problem that can be used in many different situations. Patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system."

Online code playgrounds and tools for devs

By Michael Williams, Published on 03/08/2016

Sometimes it's not possible to have a full development environment with an IDE or text editor handy. Other times you may need to collaborate or visualize what you're working on. Here are some of the tools I've used over time.

codeanywhere - This is a cross platform cloud IDE, that of the time of this writing has 75 Programming languages syntax, Code completion (js, php, html, css), All device and browser support, etc.. There is a free option available that I don't find lacking at all. You essentially have a full development environment where you can even ssh through their interface to edit your code in VIM if desired.

Custom error pages in Laravel 5

By Michael Williams, Published on 02/28/2016

Laravel 5 includes a 503 error template in /resources/views/errors by default.

To add a 404 or other error template. All you need to do is create the corresponding file within your errors directory. For example, 404.blade.php. This template will now be displayed whenever a user attempts to view a url that doesn't exist.

1 2 3 4