Laravel 5 Essentials
eBook - ePub

Laravel 5 Essentials

Martin Bean

Condividi libro
  1. 144 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Laravel 5 Essentials

Martin Bean

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Laravel 5 Essentials è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Laravel 5 Essentials di Martin Bean in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Programming in PHP. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
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...

Indice dei contenuti