售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
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
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜