Alecaddd | Designer Developer Dreamer

Web Design and Development, Digital Painting, Music and Life

  • Who
  • What
  • Uses
  • Blog
Posted in Tutorials

Laravel for beginners: 5 things to do after installing laravel

So, you’re playing around with your new Laravel toy and living your developer dream? Good!

Isn’t that awesome? Learning a new program/framework/whatever is always exciting and extremely rewarding, so, just because I feel you and I totally understand you, here are my personal tips about 5 things that everyone should do after the first installation and before starting to develop something with Laravel.

 

Activate the Debug

By default the Debug option in Laravel is deactivated, that means if your application encounters an error for whatever reason, it’ll display a totally anonymous page like this one.

laravel_error

And of course you will be like “OMG, what’s going on???”, but before starting to freak out, you can easily activate a more complete error messaging system by simply accessing the file app.php located inside this path:

app/config/app.php

Here you change the value of the variable debug, from false to true. Now, if an error will occur Laravel will tell us everything about it.

laravel_error_debug

Way more useful, but of course remember to put the variable back to false before releasing your application.

 

Configure your Timezone

In the same file you can also properly configure your Timezone variable to match your server or country time zone. This is important because this setting will affect the timing of the date and date-time functions, and of course your ability to easily check when something happened.

 

Configure your Database

To configure a database connection, local or remote, open the database.php file located in the same folder as the app.php file. Here you can set the parameters for you favourite database and put it as the default one. This file is really handy because it gives you the ability to configure multiple databases at the same time and easily select the one to use by changing the value of the default variable. Just remember that Laravel needs a database password, even if you’re creating a connection to a local one.

Switching from your development database to the production one has never been so easy.

 

Create a default View with .blade

bladeUsing Laravel and not using the .blade extension from the beginning is like going for an ice cream and ask to put it on your hand without the cone. Poor ice cream…

Blade is the default and super powerful template engine that comes with Laravel, and to use it you just have to add the extension .blade to all your files (e.g. index.blade.php) 

In this way all your files will be “connected” to each other, giving you the ability to include files inside others or only portion of those files, printing PHP variables without using any PHP syntax and appending multiple contents dynamically such as sidebar or footer.

Pretty awesome, right? For more informations and a small tutorial take a look at the official documentation of the Laravel Template System

 

Take a step back and think about your structure

This is more a personal recommendation than an actual advice. Laravel is really powerful and easy to use, but at the beginning can be really confusing and sort of messy. So, before putting your head down and start coding, remember to take a deep breath and think about your goals, which controllers you’ll need and how to split all your views into a clean and accessible folders structure.

Always remember that things could get out of control really fast!

 

Well, that’s it, those are my tips and I really hope that someone will find them useful.
And what about you? What’s your “something that you should totally do” after the Laravel installation?

If you have more tips or suggestions please write a comment and I will add them to this list, and of course if you liked this article please think about sharing it.

Cheers

 

Posted on September 4, 2014September 4, 2014
  • Twitter
  • Facebook
  • Reddit
  • Pinterest
WordPress 101: WordPress for beginner developers
Using Adobe Brackets as your default Code Editor

Recent Posts

  • Thunderbird Development – Implementing Customizable Shortcuts September 4, 2024
  • Featured image of windows loval web development setupEasiest Windows Development Setup – WordPress, Laravel, NodeJS in 5 minutes May 15, 2022
  • We are the generation of forced nostalgia March 27, 2022
  • Working on Thunderbird. UX and UI challenges of an Open Source project. February 23, 2021
  • XP-Pen Artist 12 Pro Review and International Giveaway! January 14, 2020

Podcast Episodes

  • Episode 44 – The Nerds are back! May 18, 2020
  • Episode 43 – This is awkward…getting settled into your new role May 12, 2019
  • Episode 42 – We need to talk about Gutenberg Development Workflow… February 24, 2019
  • Episode 41 – You’re not a real developer, unless… February 18, 2019

Categories

  • Coding 1
  • Reviews 8
  • Tutorials 12
  • Updates 18