The definitive introduction to the Laravel PHP web development framework.
- Create databases and models using Laravel migrations and the powerful Eloquent model
- Get started with a useful application example that is immediately applicable to real-world applications
- Learn how to implement powerful relationships with Eloquent
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's philosophy is to provide a highly flexible architecture and an extremely expressive API while emphasizing PHP’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're able to reduce our workload, application complexity, and human-error.
"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.
It starts out by installing and configuring the framework step-by-step. Then you'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'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.
Focused on the how as much as the why, Laravel Starter gives you the tools to immediately begin creating professional web-applications with Laravel.
What you will learn from this book
- How to install and configure Laravel
- Creating and using Eloquent models
- How to understand and utilize Eloquent relationships
- Routing to controllers and closures
- Using Laravel's authentication system
- Utilizing filters to secure your site's private areas
- Learn how to use bundles to add functionality to your site
- Use Laravel's validator class to validate your forms or anything else
- Use form and HTML helpers to abstract and ease working with some HTML elements
This book is a practical, task-based, step-by-step tutorial that demonstrates topics ranging from MVC code-separation, to code-modularity, to utilizing ActiveRecord for data abstraction which are explained from the ground-up to provide a strong framework of understanding for creating professional web-applications with Laravel.
Who this book is written for
This book is ideal for programmers familiar with PHP who are interested in learning the Laravel way of solving the common problems faced in their day to day work.
these rows represents a single user of your site. Your User model is a class that extends the Eloquent Model class. When you query a record from your database, an instantiation of your User model class is created and populated with the information from the database. A distinct advantage of ActiveRecord is that your data and the business logic that is related to the data are housed within the same object. For example, it's typical to store the user's password in your model as a hash, to prevent
$new_student_information = array( 'name' => 'Danielle' ); $course->students()->insert($new_student_information); Here we're adding a new student to our course by using the method insert(). This method is specific to this relationship type and creates a new student record. It also adds a record to the course_student table to link the course and the new student. Very handy! But, hold on. What's this new syntax? $course->students()->insert($new_student_information); Notice how we're not
this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of
with() method allows us to pass data from the controller into the view. This method accepts two arguments. The first argument is the name of the variable that will be created in the view. The second argument will be the value of that variable. To recap, we've queried the database for all users and passed them as an array of User objects to the view. The array of User objects will be available in the view as the variable $users due to the fact that users was the first argument to the with()
been involved in professional web-application development for 15 years. His work emphasizes a philosophy of long-term software maintainability. Shawn joined the Laravel team in 2012 and has been involved in updating and improving the official documentation. Shawn is highly involved in community education and regularly creates education content and makes it freely available on his company site http://heybigname.com. Shawn spends much of his time involved with the Laravel community and can