This book is intended for PHP web developers who have an interest in Laravel and who know the basics of the framework in theory, but don't really know how to use it in practice. No experience of using frameworks is required, but it is assumed you are at least familiar with building dynamic websites in PHP already.
Cover Copyright Credits About the Author About the Reviewers www.PacktPub.com Table of Contents Preface Chapter 1: An Introduction to Laravel The need for frameworks The limitations of homemade tools Laravel to the rescue A new approach to developing PHP applications A more robust HTTP foundation Embracing PHP Laravel's main features and sources of inspiration Expressiveness and simplicity Prettifying PHP Responsibilities, naming, and conventions Helping you become a better developer Structure of a Laravel application The service container and request lifecycle Exploring Laravel Changes in Version 5 from Version 4 Summary Chapter 2: Setting Up a Development Environment Meeting Composer Working with the command line Meet Homestead Installing Homestead Everyday Homestead usage Adding additional websites Connecting to your databases Creating a new Laravel application Summary Chapter 3: Your First Application Planning our application Entities, relationships, and attributes The map of our application Starting the application Setting the application namespace Writing the first routes Restricting the route parameters Handling HTTP exceptions Performing redirections Returning views Preparing the database Creating Eloquent models Building the database schema Seeding the database Mastering Blade Creating a master view Back to the routes The overview page Displaying a cat's page Route-model binding Adding, editing, and deleting cats Moving from simple routing to powerful controllers Resource controllers Summary Chapter 4: Eloquent conventions Retrieving data Filtering records Saving data Mass assignment Deleting data Soft deletion. Including deleted models in results Query scopes Relationships One-to-one Many-to-many Storing data in the pivot table Has-many-through Polymorphic relations Many-to-many polymorphic relations Model events Registering event listeners Model observers Collections Checking if a key exists in a collection Summary Chapter 5: Testing - It's Easier Than You Think The benefits of testing The anatomy of a test Unit testing with PHPUnit Defining what you expect with assertions Preparing the scene and cleaning up objects Expecting exceptions Testing interdependent classes in isolation End-to-end testing Testing - batteries included Framework assertions Impersonating users Testing with a database Inspecting the rendered views Summary Chapter 6: A Command-line Companion Called Artisan Keeping up with the latest changes Inspecting and interacting with your application Fiddling with the internals Turning the engine off Fine-tuning your application Caching routes Generators Rolling out your own Artisan commands Creating the command The anatomy of a command Writing the command Scheduling commands Viewing output of scheduled commands Summary Chapter 7: Authentication and Security Authenticating users Creating the user model Creating the necessary database schema Authentication routes and views Middleware Validating user input Form requests Securing your application Cross-site request forgery Escaping content to prevent cross-site scripting (XSS) Avoiding SQL injection Using mass assignment with care Cookies - secure by default Forcing HTTPS when exchanging sensitive data Summary Appendix: An Arsenal of Tools Array helpers The usage examples of array helpers. String and text manipulation Boolean functions Transformation functions Inflection functions Dealing with files File uploads Sending e-mails Easier date and time handling with Carbon Instantiating Carbon objects Outputting user-friendly timestamps Boolean methods Carbon for Eloquent DateTime properties Don't wait any longer with queues Creating a command and pushing it onto the queue Listening to a queue and executing jobs Getting notified when a job fails Queues without background processes Where to go next? Index.
Description based on publisher supplied metadata and other sources.
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2021. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.