Book Image

Laravel Starter

By : Shawn McCool
Book Image

Laravel Starter

By: Shawn McCool

Overview of this book

<p>Laravel is fundamentally changing the PHP web-development landscape. Laravel is bringing the paradigm-shifts that PHP developers have been craving. We now can take control of our application architecture and advance our craft without needing to fight against our tools. Laravel&rsquo;s philosophy is to provide a highly flexible architecture and an extremely expressive API while emphasizing PHP&rsquo;s strengths and abstracting out its weaknesses. For these reasons Laravel is ideal for quickly creating high performance, robust applications. By providing developers with tools for automating tasks including database schema modification, CRUD operations, and testing we&rsquo;re able to reduce our workload, application complexity, and human-error.<br /><br />"Laravel Starter" is the ideal introduction to this game-changing framework. Learn best-practiced approaches to web-application development with Laravel from a seasoned professional.<br /><br />It starts out by installing and configuring the framework step-by-step. Then you&rsquo;ll use Laravel best-practices to create a private user administration system that is ready for real-world use. The later part deals with digging deep into Eloquent relationships, exploring the different relationship types and how Eloquent is working under-the-hood to simplify your life without forcing you to relinquish control. Exploring Laravel&rsquo;s simple yet flexible authentication system, data validation, and filters allows you to easily run code before and after your controller actions. Finally, it discusses Laravel bundles, the most flexible PHP modular code implementation in its weightclass.<br /><br />Focused on the how as much as the why, Laravel Starter gives you the tools to immediately begin creating professional web-applications with Laravel.</p>
Table of Contents (8 chapters)

So, what is Laravel?


Laravel is an MVC web-development framework written in PHP. It has been designed to improve the quality of your software by reducing both the cost of initial development and ongoing maintenance costs, and to improve the experience of working with your applications by providing clear expressive syntax and a core set of functionality that will save you hours of implementation time.

Laravel was designed with the philosophy of using convention over configuration. This means that it makes intelligent assumptions about what you're trying to accomplish so that in most situations you'll be able to accomplish your goals with much less code. Not every application and database that you'll work with will be designed using these conventions. Thankfully, Laravel is flexible enough to work with your system—no matter how unique it is.

Laravel has been designed to target the sweet-spot between minimalism and functionality. It's easier to understand smaller code bases and Laravel is all about implementing solutions in a way that is clean, simple, and elegant. Long-time PHP developers will find many aspects of Laravel familiar as it is an evolution of the PHP development frameworks that have come before it.

Laravel is one of the few PHP frameworks that offers true code modularity. This is achieved through a combination of drivers and its bundles system. Drivers allow you to easily change and extend caching, session, database, and authentication functionality. Using bundles, you're able to package up any kind of code for either your own re-use or to provide to the rest of the Laravel community. This is very exciting because anything that can be written in Laravel can be packaged as a bundle, from simple libraries to entire web-applications. The Laravel bundle website allows you to browse bundles that have been built by the community as well as to showcase your own. It is a valuable resource of third-party libraries and subsystems that can dramatically ease the development of your web-application.

Laravel also provides a cutting-edge suite of tools for interacting with databases. Database migrations enable you to easily design and modify a database in a platform-independent way. The migrations can then be run against any of the database types that Laravel supports (MySQL, PostgreSQL, MSSQL, and SQLite) and you won't have any compatibility issues.

Laravel's Fluent Query Builder abstracts away the differences between different database types. Use it to build and execute robust queries.

Laravel's ActiveRecord implementation is called Eloquent. Interacting with a database in an object-oriented way is the modern standard. With Eloquent, we can create, retrieve, update, and delete the database records without needing to write a single line of SQL. In addition to this, Eloquent provides powerful relationship management and it can even handle pagination automatically for you.

Laravel also ships with a command-line interface tool called Artisan. With Artisan, a developer can interact with their application to trigger actions such as running migrations, running unit tests, and running scheduled tasks. Artisan is also completely extendable so that you can write any type of functionality that you'd like. Laravel's easy-to-manage routing system allows you to easily manage your site's URLs. By using the built-in HTML helper, you can create links within your site that will automatically update themselves if you change the URLs that make the job of maintaining your site much easier.

The Blade templating engine cleans up your views by providing aesthetically pleasing replacements for inline PHP and by including powerful new features.