Yet another

laravel journey

If you would like to install dependencies in laravel there are 2 ways to do so, you can either open up your composer.json file and edit it to put in the dependencies you would like to include inside your project. This is an example of what can be found inside my composer.json file:

Once you have noticed the breeze the blade templating engine will bring into your templates, it’s about time to share a flexible template setup. I’ll share mine below but it’s by far the best setup in every situation.

Lately I switched from MAMP to AMPPS but I’m still a bit unsure if that was the right move. I got a bit tired with the MAMP interface and not having an easy softaculous installer for testing, though things worked perfect. Today I finally was able to solve a problem I was having with AMPPS for the last few weeks, I was unable to change the PHP version although all settings were fine. Typing this inside the terminal temporarily fixes it:

If you have never worked with a templating engine it’s about time you open the door to let a breeze run through your projects! I’m sure you will be amazed about how easy Blade will be to use as well as how clean your templates will look. Sharpen your Blades, here we go!

This is what my controller function would look like, it’s called from the routes file and will make sure our application has maximum flexibility.

When you start doing routing and add some rules, in the beginning it’s easy to make a lot of mistakes. Because I didn’t want others to see the output laravel throws on the screen I decided to start looking for a solution to add custom error pages. In Laravel 5 you can get this done by going into app- Http - Kernel.php.

Here you should add the following to make sure the right class is called and a Response object can be made.

use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Response;

Most, if not all, routing will be done inside the app/routes.php file. Here you’ll already find a very basic example which will be called to view the first template, I’ve extended mine with a few others to experiment a bit.