Camron Cade

Artisan web development, mostly using Laravel.

Cloud Scanner with Raspberry Pi & Fujitsu ix500

My end goal here is to have a completely headless Raspberry Pi. Push the scan button, and the Pi does all the work scanning, processing, and putting the outputted files in a shared network folder. Here's what I did to get this working. 1. Install Raspbian Follow any guide - there're everywhere. I bought...

Read More

Blade shortcut for echoing variables that may not be set

Laravel is one of those frameworks that has hidden tricks that are a delight to stumble across. This is one of them. In your blade templates, you've probably done something like this: {{ $day->common_sense }} This is all fine and dandy, but what if the day doesn't exist? What if the day doesn't...

Read More

Things to note when using Dompdf

While using Dompdf for a project I came across two small things that are worth noting. Dompdf is a PHP package that converts html/css markup into a PDF. It's not super stable and can be gimmicky at times, but it works. 1. Image widths After struggling to get Dompdf to respond to CSS,...

Read More

The list() function [PHP]

The list() function was one of those functions that I didn't learn about in any PHP course, but has stumbled across while looking at others code. It's not really a function, but is a language construct but can be very handy. Basically, it unpacks arrays and assigns the keys individual variables. Here's an example...

Read More

Understanding Class Aggregation and Composition

If you spend anytime reading up on design patterns (I recommend this book), you'll come across terms like class association, aggregation, and composition. I recently stumbled into these and realized I didn't quite understand what they meant, nor what they might look like in the real world. Below is my understanding of the terms...

Read More

DB instance without using facades in Laravel's Lumen

The point of Lumen is that it is light and fast, and so by default helpful tools like Eloquent and Facades are disabled. I like to try and keep it light when I am using Lumen, so I opt to not turn them on. If you, like me, are used to using the facade...

Read More