万本电子书0元读

万本电子书0元读

顶部广告

Laravel 5 Essentials电子书

售       价:¥

15人正在读 | 0人评论 6.2

作       者:Martin Bean

出  版  社:Packt Publishing

出版时间:2015-04-28

字       数:79.3万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
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.
目录展开

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

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部