How To Send Email To New Users

How To Send Email To New Users

Almost every modern web application has the ability to send email to users at various points in time. In fact, some might say that some of these companies have downright abused the idea of sending user email notifications and send them at every possible instance. We’re not going to look at how to do that here. It might be nice however to be able to send a Welcome Email to new users that sign up for your web application.…

How To Test Your Laravel Application

How To Test Your Laravel Application

Laravel leverages the popular PHP testing framework PHP Unit as a dependency, which makes it possible to set up testing facilities on the applications you build with Laravel. If we look inside of our current Laravel installation, we can see there is a tests directory which holds two sub directories. The sub directories are those of Feature and Unit. Of course these are the locations of setting up tests you would like to have for your application.…

How To Add Flash Messages

How To Add Flash Messages

Flash messages are a great way to add some simple notifications to users of your website or application about important events that may have happened. HTTP is a stateless protocol so in order to display a message after a particular request has happened, we can make use of sessions which maintain state from one request to the next. Flash messages utilize a special type of session which only maintain themselves long enough for a message to be displayed once and only once.…

What is a View Composer in Laravel?

What is a View Composer in Laravel

View Composers provide a very elegant solution to a very specific problem. If you have spent some time building in Laravel, you likely have at some point come across the Undefined variable error exception getting thrown from a view file. So you inspect your methods in your controllers, figure out where you forgot to fetch some specific information, then make the fix, and your error goes away.…

How To Select Raw SQL Using Eloquent

How To Select Raw SQL Using Eloquent

In this installment of our games app, we are going to add a sidebar for the main games and reviews views. In other words, when the site user is listing all games to view or all reviews to see, there will be a sidebar displayed. This sidebar will hold information about the games and reviews that have been submitted by users of the site. Specifically, we would like to show the user who has submitted the most games first, the user who has submitted the second most games second, and so on.…