During application development sending test emails can usually be a pain, even when using a modern frmaework like the excellent Laravel 4. During development it is very desirable to debug emails without actually sending them.There are a few options I’ve come across:
- Use Laravel 4’s Mail pretend feature. Simply set the configuration key “pretend” to true in app/config/mail.php. Laravel will now not send emails, instead write the content of each email to the application log
- Manually change the “to” email to your own so emails are delivered to your favourite email client – again, messy if sending lots of emails and if you ever made a mistake
- Print out the email data directly to the screen, but don’t send the actual email – the worst solution in my opinion
Options 2 and 3 are particularly fraught with issues. For instance, assume the application was to send out 1000 member renewal reminders and during development the route that sends out the emails was hit. Very soon, we’d have some very real (and confused, annoyed etc.) customers contacting you – disaster!
Continue reading Mailcatcher & Laravel 4 – Sending Development Emails
The Opencart Multistore feature is a great addition for retailers requiring multiple stores, managed via a single administration area. Setting up multistore in Opencart is quite easy and can be accomplished in a few minutes.
However, after visiting the new store you’ll immediately see that existing products, categories, customers, page layouts etc. have not transferred over. Ouch! The new store is completely empty.
Continue reading Opencart 1.5.x Multistore – Associating Existing Data
When using the excellent Laravel 4, writing DRY and SOLID code is something you’re well aware of. Unfortunately, it’s common for the routes file to get messy and repetitive as an application grows – enter the route pattern method. Even worse (in my opinion) is performing basic and repetitive validation of parameters in controllers.
Consider a routes file that responds to 4 simple URIs:
Continue reading Route Patterns in Laravel 4
SSH, or Secure Shell is something any web developer will have come across. Personally, every single website I deploy involves SSH where I’ll upload and extract a single compressed archive. This is simply good practice and most importantly, much faster than normal FTP. There are a plethora of further benefits in having SSH access – I won’t go into these here though. However, as common a feature as SSH access is, gaining SSH Access on a Heart Internet hosting account surprisingly, turns out to be pretty darn hard to get.
Continue reading SSH Access & Heart Internet, oh my …
Database seeding can be a pain to perform and end up very clumsy. Seeding is a process required in the majority of web applications – either for stress testing or just to generate a reasonable sample of test data during testing. Laravel 4 already has database seeding and migrations built in, which of course is great. However, the functionality to generate the actual sample data is lacking. Enter Faker – a package, available via composer. The author describes this better than I can:
Faker is a PHP library that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker is for you.
Continue reading Laravel 4 Database Seeding with Faker
I’ll keep this purposely short. I’m just in the process of attempting to transfer a basic 3 page static “Talktalk business website”, with a contact form from TalkTalk Business to my own hosting provider. This should be an easy task and a task I can do blindfolded for a tiny static website consisting of 3 pages.
My client asked TalkTalk for a copy of the site’s files (which will consist of a couple of html files and a single server side script to process the contact form). Nothing ground breaking by any means.
Continue reading TalkTalk Business Websites – A Brief Encounter
Opencart have implemented product filters as of 1.5.5. In my opinion, category level product filters are a much needed feature and something Opencart has been lacking for a while. However, in true Opencart style, to date their documentation/announcement is completely lacking, simply citing “Product Filters” as a new feature – even their demo store still uses Opencart 1.5.4, meaning you won’t even be able to see the amazing new Opencart product filters in action!
Continue reading Opencart 1.5.5 – Product Filters
Counter Cache (or Counter Cache Columns) is the term coined when adding a column to data tables in order to keeps track of aggregate data in an application. The term “cache” is used because the application has no need to perform costly count queries. It can simply read the value of the “count column”. This practice is less costly when compared to performing separate database queries. The worst case scenario, where the application has database queries within a loop is avoided too.
Continue reading Counter Cache
Nowadays, companies and brands are wide open to criticism and comments from anyone with an Internet connection. With the dramatic rise of social media, there is no place to hide. Brands and companies needs to deal with such negative criticism and comments in an open, yet transparent way. The worse thing any brand or company can do is to not respond to such comments or try to cover them up with deceptive tactics such as fake replies, negative SEO, paid reviews etc.
Continue reading Bodyforms’ Perfect Response to Facebook Rant
A Different take on the normal “Website Transfer Guide” …
Taking over, or inheriting responsibility for an existing website happens to any web designer or developer at some point. In theory, website transfers sound extremely minor and insignificant – take a backup of the site, re host and away you go. As a result, if you Google something generic like “transfer web site” you’ll get lots of guides that are technically correct but rarely work in theory, as external factors have a big part to play. For instance, look at the website transfer guide of 123-reg.It appears transferring a site is a case of following a couple of basic points. It really isn’t! In reality, taking responsibility for a website is an absolute minefield and deceptively complex. A website transfer guide should reflect these complexities. What follows are some points to consider, from the view of a web developer when doing just that.
Continue reading Website Transfer Guide – Common Pitfalls & Solutions