Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Mail Logging in Laravel 5.3: Extending the Mail Driver
Sep 26, 2016 @ 11:54:40

On the SitePoint PHP blog there's a new tutorial posted by Younes Rafie looking at logging of mail handling in Laravel by extending the already included driver with your own updates.

One of the many goodies Laravel offers is mailing. You can easily configure and send emails through multiple popular services, and it even includes a logging helper for development.

[...] Laravel also provides a good starting point for sending mails during the development phase using the log driver, and in production using smtp, sparkpost, mailgun, etc. This seems fine in most cases, but it can’t cover all the available services! In this tutorial, we’re going to learn how to extend the existing mail driver system to add our own.

They start by helping you create the service provider used to log the mail information to a database table (the DBMailProvider). The extend the existing mail provider class and set it up to register the Swift Mailer provider if the configuration for the mailer is not set to "db". The the tutorial shows how to update the provider to override the swift.mailer instance in the application dependency injection container and include the code to override the "send" method. A migration is created to hold the mail data and a matching Emails model is used to save the mail results.

tagged: laravel email logging database tutorial driver swiftmailer configuration

Link: https://www.sitepoint.com/mail-logging-in-laravel-5-3-extending-the-mail-driver/

Laravel News Podcast:
Episode 26 - Laravel 5.3.8, Spark 2, Lumen 5.3 and more!
Sep 21, 2016 @ 11:14:23

The Laravel News podcast has released their latest episode, Episode #26, covering "Laravel 5.3.8, Spark 2, Lumen 5.3 and more" with hosts Eric L. Barnes and Jack Fruh.

In this week's episode, we discuss the new Laravel 5.3.8, briefly cover Spark 2 & Lumen 5.3, and talk a lot about our progression of code editors.

They also talk about the latest release of Vim (8.0), a popular text editor, and the fact that GitLab raised $20 million in function along with their "master plan" announcement. You can listen to this latest episode either through the in-page audio player or you can subscribe to their feed and get this and other future episodes delivered directly to your reader.

tagged: laravelnews laravel podcast news ep26 ericbarnes jackfruh

Link: https://laravel-news.com/podcast/26

Freek Van der Herten:
Simplifying presenters in Laravel
Sep 20, 2016 @ 09:32:17

Freek Van der Herten has a quick post to his site with a tip about simplifying presenters in your Laravel based application. The "presenters" here are in relation to this package and how it helps with the output of the application.

In the Laravel template that we use to kickstart all our client projects at Spatie, I recently changed the way we handle presenters. Instead of using Jeffrey Way’s popular presenter package we now use simple traits. In this post I want to give some background on that change.

He gives a quick "crash course" on presenters for those not familiar with the concept and how it helps to keep view logic out of places like models and controllers. He briefly describes a presenter class that would return the "first name + last name" combination and what the code could look like. Then it's just a matter of using that trait (the class mentioned just before this) and a new magic property is defined to use in the view.

tagged: laravel presenter view logic property example user name

Link: https://murze.be/2016/09/simplifying-presenters-laravel/

Freek Van der Herten:
Taking care of backups with Laravel
Sep 19, 2016 @ 09:34:13

Freek Van der Herten has posted a new article to his site covering the backup of your Laravel-based application with a handy package, laravel-backup. He's released a new major version so he wanted to catch you up on some of the features and functionality the package includes and how to use them for your application.

A new major version of laravel-backup was recently tagged. This package can backup files and databases of your Laravel app (or any PHP application really). The backup consists of a zipfile containing a dump of the databases and all files that are selected for backup. The package will copy over the zipfile to external storage such as S3, Dropbox, SFTP, … If something goes wrong during the package can notify you via, amongst others, mail or Slack. In this post I’d like to give some background on why and how it was built.

Keep in mind that there is no one size fits all solution for backups. A small company will probably handle backups in another way than a bigger company. This post has small companies in mind with a couple of developers and no dedicated operations person or team.

He starts off talking about "modern hosting" services and some of the issues that can come with them (downtime being one of the worst). He point out that providers like Linode and DigitalOcean only make periodic backups of your application and restoring from these could mean a lot of data loss - one of the worst things that can happen to an online business. With the laravel-backup package protecting against this kind of failure is easier, letting you automatically back up your site to an off-server source (like S3, Dropbox, or even another local location). He also describes the handling to clean up old backups, sending notifications when problems come up and simple monitoring functionality. He ends the post by mentioning once again that this package is designed for use with small-to-medium sized applications. Larger ones should work up a more robust, possibly external solution that doesn't rely on the application framework for its functionality.

tagged: backup laravel package laravelbackup tutorial downtime

Link: https://murze.be/2016/09/taking-care-of-backups-with-laravel/

Laravel News:
The 2016 Laravel Survey
Sep 16, 2016 @ 10:16:01

On the Laravel News site there's a new post talking about a survey that's being put out by the LaraJobs site/service with questions covering the current state of the Laravel community.

The Laravel community is growing fast and we thought it’d be interesting to see what types of projects people are taking on with Laravel as well as get some feedback on what the Laravel community could be doing better.

If you’re a Laravel developer or in charge of a Laravel team and have a few minutes we’d love for you to take the survey.

The survey will run for a few weeks and at the end, the results will be tabulated, analyzed and shared on the Laravel News site. Even if you're not a Laravel user, you might want to take this poll (don't worry, it's anonymous) and share some about why you don't use the framework - there's a few questions about that too.

tagged: laravelnews survey laravel community 2016 developer larajobs

Link: https://laravel-news.com/2016/09/the-2016-laravel-survey/

Jason McCreary:
Laravel Shift - 1,000 applications upgraded
Sep 14, 2016 @ 10:27:41

Jason McCreary, the developer behind the Laravel Shift upgrade service, has posted a retrospective of his work on the project and some of the things he's learned along the way. The service just recently topped 1000 applications upgraded.

Less than a year ago I created Laravel Shift. While not my first product, it is my first software as a service (SaaS). If you’re not familiar with Laravel Shift or interested in the backstory check out the Q&A on Laravel News or listen to the interview on Full Stack Radio.

In this post, I want to focus more on reaching the milestone of 1,000 Laravel applications upgraded. This may not sound like many, however for my first SaaS product it marks the achievement of my stretch goal. So allow me to share the most important decision, biggest challenge, and what the future holds for Laravel Shift.

He starts with a section talking about the difference between a "project" and a "product" targeted at developers who, usually, have more than one project going at a time. He talks about his decision to move Shift to a "product" and some of the hurdles he hit because of being "a developer, not a marketer". He finishes the post looking ahead to things coming with the service and the announcement of "human services" being offered to get a live person involved in the upgrade of your Laravel application.

tagged: laravel shift service retrospective future plans 1k upgrade milestone

Link: http://jason.pureconcepts.net/2016/09/laravel-shift-1000-applications-upgraded/

Understanding the Laravel Service Container
Sep 13, 2016 @ 12:56:04

The Dotdev.co blog has posted a tutorial for the Laravel users out there with the goal of helping you understand the Laravel service container, a key part of the framework's functionality and an extensible feature you can adapt to some of your own needs.

Learning how to build an application with Laravel is not just about learning to use the different classes and components within the framework, it is not about remembering all artisan commands or remembering all helper functions (we have Google for that). Learning to code with Laravel is learning the philosophy of Laravel, its elegance and its beautiful syntax. I personally feel it is an art and a craft (its not a coincidence that Laravel developers are sometimes referred to as Web artisans). This is true for any other framework as well.

A major part of Laravel’s philosophy is the Service Container or IoC container. As a Laravel developer, understanding and using the Service Container properly is a crucial part in mastering your craft, as it is the core of any Laravel application.

The post starts with some of the basics about the container and how objects/instances are bound to it. They give an example of binding a FooService class in the "register" methods of providers. A code example is also included showing how to use the service you previously bound. There's also a description of binding interfaces in the IoC, making it easier for custom classes to resolve interfaces when they're implemented. The post wraps up with a bit covering the resolving of dependencies and the code you'll need to set them up.

tagged: laravel service container introduction tutorial framework bind

Link: https://dotdev.co/understanding-laravel-service-container-bd488ca05280#.9gd6v3t4l

Laravel News:
Laravel Spark v2 is now released
Sep 12, 2016 @ 10:52:22

On the Laravel News site there's an announcement posted about the latest release of Laravel Spark (v2). Spark is a commercial package from the creator(s) of Laravel that provides simpler billing for subscription-based services.

Laravel Spark, the commercial Laravel package that provides instant scaffolding for subscription billing, has just released v2.

The 2.0 release is a free upgrade for all license holders and it adds compatibility with Laravel 5.3 as well as deprecating the Spark installer in favor of using Composer directly.

This also adds dependency updates so it is compatible with both Echo and Passport that are new packages in Laravel 5.3.

There's an upgrade guide for those that are needing to bring their install up to the latest release. If you're more interested in what Spark has to offer, check out the main page for the product. A single-site license costs $99 USD and includes a wide range of features and technologies to make managing your subscription-based service simpler.

tagged: laravel spark release version feature upgrade

Link: https://laravel-news.com/2016/09/spark-v2/

Laravel News Podcast:
Episode #25 - Laravel 5.3 and Shift with Taylor Otwell and Jason McCreary
Sep 07, 2016 @ 11:11:46

The Laravel News podcast, hosted by Eric Barnes and Jack Fruh, has shared its latest episode today: Episode #25 - Laravel 5.3 and Shift with Taylor Otwell and Jason McCreary.

In this episode, we are joined by Taylor Otwell and Jason McCreary to discuss Laravel 5.3, Laravel's first hire, and Laravel Shift.

Besides the topics already mentioned they also discuss Laravel Forge and Laravel Passport. You can listen to this latest episode either using the in-page audio player or by downloading the episode directly. If you enjoy the show be sure to subscribe to their feed or on iTunes/Google Play to get the latest episodes as they're released.

tagged: laravelnews laravel podcast news ep25 v53 shift taylorotwell jasonmccreary

Link: https://laravel-news.com/podcast/25

Laravel News:
Building a Search Engine Friendly Sitemap XML with Laravel
Sep 06, 2016 @ 10:51:05

On the Laravel News site today there's a post showing you how to create a basic sitemap for your Laravel-based application. This method uses straight up Laravel functionality (not the method previously mentioned in another post).

A few years ago search engines recommended submitted sitemaps to help with indexing your website and now the importance of this is debatable.

I’m of the mindset creating and submitting can’t hurt, so I spent a little time putting one together and wanted to share how easy this is in Laravel. [...] A sitemap is a file where you can list the web pages of your site to tell Google and other search engines about the organization of your site content. Search engine web crawlers like Googlebot read this file to more intelligently crawl your site. [...] On the official Sitemaps website it outlines all the information you will need for building your own sitemap.

He outlines some reasons why your site might need a sitemap before getting into examples and the code to create them. He starts with the controller and moves into making the index (with matching XML view) and the endpoints for the URLs referenced in the main sitemap. Finally a few routes are added for each endpoint and links to extending the contents and structure are included.

tagged: laravelnews laravel tutorial sitemap example xml

Link: https://laravel-news.com/2016/09/laravel-sitemap/