Laravel 5 Essentials
eBook - ePub

Laravel 5 Essentials

Martin Bean

Compartir libro
  1. 144 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Laravel 5 Essentials

Martin Bean

Detalles del libro
Vista previa del libro
Índice
Citas

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Laravel 5 Essentials un PDF/ePUB en línea?
Sí, puedes acceder a Laravel 5 Essentials de Martin Bean en formato PDF o ePUB, así como a otros libros populares de Computer Science y Programming in PHP. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2015
ISBN
9781785283017

Laravel 5 Essentials


Table of Contents

Laravel 5 Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
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
2. Setting Up a Development Environment
Meeting Composer
Working with the command line
Meet Homestead
Installing Homestead
Everyday usage of Homestead
Adding additional websites
Connecting to your databases
Creating a new Laravel application
Summary
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
4. Eloquent ORM
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 whether a key exists in a collection
Summary
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
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 the output of scheduled commands
Summary
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
A. 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

Laravel 5 Essentials

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of 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 capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2015
Production reference: 1240415
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-301-7
www.packtpub.com

Credits

Author
Martin Bean
Reviewers
Si Fleming
Michael Peacock
Brayan Laurindo Rastelli
Michele Somma
Commissioning Editor
Akram Hussain
Acquisition Editor
Reshma Raman
Content Development Editor
Mohammed Fahad
Technical Editor
Ankur Ghiye
Copy Editors
Merilyn Pereira
Laxmi Subramanian
Project Coordinator
Danuta Jones
Proofreaders
Safis Editing
Paul Hindle
Indexer
Monica Ajmera Mehta
Production Coordinator
Nilesh R. Mohite
Cover Work
Nilesh R. Mohite
2323__pe...

Índice