Archive | PHP

How to migrate data from Laravel Cashier 5 to 6

In this post I will outline migrating your existing subscription data from Laravel Cashier version 5 to version 6. In version 6, Cashier got a nice update to handle multiple subscriptions but there is not guide to migrate your data. Fear not, it’s actually pretty easy! The first thing you should do is backup your […]

Continue Reading 2
Laravel Logo

Laravel 4 – Pivot vs Polymorphic – Part 1

PHP has come a long way! Coming from the Rails world back to PHP has actually been pretty painless thanks to Laravel. One of the first things that stumped me was under what circumstances to use pivot vs polymorphic relationships. This post is more of a reminder for myself but I hope it clarifies things […]

Continue Reading 2

PHP: Handle comma separated input

A quick example of how to handle comma separated input from a POST variable in PHP. The code below will turn your POST variable into an array containing the user’s input which you can further validate or store in a database. This is useful for letting users add tags to items on your website.

Continue Reading 1

Check image type in PHP

Quick PHP tip: If you’re looking to determine the type of uploaded image you can use the following code:

The code above shows a snippet to check if the uploaded image was a jpg, gif or png image type. As stated on the PHP documentation, this will return the same value as getimagesize() but […]

Continue Reading 0

PHP base_convert() in AS3

Here is a quick example of how to use PHP’s base convert function in AS3. A lot of people use this function for shorter masked URLs like YouTube. Easy enough but took me a minute to find the equivalent in actionscript. PHP:

Actionscript 3:

Continue Reading 0

Powered by WordPress. Designed by Woo Themes