Week 3
Laravel happens to be a new adventure of mine that I have had the pleasure of cramming all the information I could in about a month. I used this Framework to build a project for my Software Construction course and my eyes have been opened to this great exciting new world.
Lets just cover what I know it can do (I have not even scratched the surface)
- Create user logins in a instant
- Password resets
- Password encryption
- Create boilerplate scaffolding
- Models
- Database migrations
- Controllers
- Built in secure routing
- To create a secure way to traverse your web application/site with out allowing a user to step where they shouldn’t
- If it is not defined as a valid place to be a link then you get returned to a error page
- This may seem intuitive yet it is not many hackers can inject SQL or hidden values through your app and laravel does a great job of keeping your app secure with tokens being required for all input forms.
- Html/PHP Blade templating Engine
- Allows for shorter syntax
- new ways to interact with your database data
- So much more that I have yet to learn.
Laravel is a Model-View-Controller Architecture. What this means is that you have your application separated into three pieces. The Model or the Database Entity, this is where you should prefer your logic and relationships to be. A great tip I learned through many tutorials is to keep your Models fat and your Controller skinny. We will get to this in a second when I explain controllers. The View is exactly what it sounds like, its the user interface. The views you make are designed in Html and PHP allowing a lot of flexibility to your applications look and feel. The Controller is the part of your application that controls the data being passed to the view and in a way is the bridge between the Model and View. Now in many attempts and tutorials it is tempting to create complex queries and logic in your controller but this is not good practice I have learned. This is because you can design your applications relationships and specific queries in your Model and this allows the database to have more predictable queries from a operational standpoint and much like any other database driven application you can make relationships using joins and other queries yet this is more expensive and unpredictable to your framework, by using the Models to its full potential you leverage the design of the database management system by having predefined relationships and reoccurring queries.
I promise I could talk about laravel for many posts, yet this was just to give you a flavor of what a Framework can do for your development by helping you focus on the details and not a hard parts like tokens and validation etc.
Laravel’s Documentation Page:
https://laravel.com/docs/5.3
Laravel Collective- allows for sleek form generation using simple syntax:
https://laravelcollective.com/
Laravel tutorial experts:
https://laracasts.com/
From the blog CS443 – Triforce Code| Exploring and Learning by CS443 – Triforce Code| Exploring and Learning and used with permission of the author. All other rights reserved by the author.