If you worked with PHP in the early days or even if you are a newcomer, you are probably familiar with how messy and painful working with another developer’s code can be. PHP has a low barrier to entry which is great for getting things done. At the same time though, it creates a culture of lazy developers. Even those developers with years of experience have coding styles that are hard to wade through.…
Read more »If you’re discussing object oriented programming in PHP these days, it’s likely that you’ve at least heard about such topics as dependency injection or IoC containers. They’re both pretty useful tools for coding and testing your code. What exactly is an IoC container though? It sounds pretty complicated but it’s really not. If you read my earlier post on using repositories in Laravel you might have noticed that when using dependency injection in our __construct method, we didn’t have to actually instantiate our repository.…
Read more »Every so often I have clients who want me to work on WordPress sites or plugins. I honestly hate working with WordPress. While it’s one of the most popular CMS products in the world with a massive developer base, I find that anything coded for WordPress tends to follow a tacky and poorly organized form of coding. Coding styles vary wildly from developer to developer and there really is no standard.…
Read more »The past couple of days I have been cramming my brain with coding knowledge. I’m working on a side project that I’ll likely announce in detail as it gets closer to launch. Since I’m starting from an empty Laravel project and building it from the ground up, I’m learning quite a bit about the framework and even some of the new features in PHP 5.4 and above. One technique I’m starting to better understand is that of dependency injection.…
Read more »As I work more and more with Laravel, I keep running across some really cool time saving tricks. One of those time savers is route/model binding. Let’s say that you have the following route setup. <?php Route::get(‘books/{book}’, function($book) { return Book::find($book); }); That’s pretty simple right? Basically you point your browser at /books and then pass a book id and then use the ‘Book’ model to fetch that book from the database.…
Read more »