Laravel Application Development Cookbook
eBook - ePub

Laravel Application Development Cookbook

  1. 272 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Laravel Application Development Cookbook

About this book

In Detail

When creating a web application, there are many PHP frameworks from which to choose. Some are very easy to set up, and some have a much steeper learning curve. Laravel offers both paths. You can do a quick installation and have your app up-and-running in no time, or you can use Laravels extensibility to create an advanced and fully-featured app.

Laravel Application Development Cookbook provides you with working code examples for many of the common problems that web developers face. In the process, it will also allow both new and existing Laravel users to expand their knowledge of the framework.

This book will walk you through all aspects of Laravel development. It begins with basic set up and installation procedures, and continues through more advanced use cases.

You will also learn about all the helpful features that Laravel provides to make your development quick and easy. For more advanced needs, you will also see how to utilize Laravels authentication features and how to create a RESTful API.

In the Laravel Application Development Cookbook, you will learn everything you need to know about a great PHP framework, with working code that will get you up-and-running in no time.

Approach

This book is written in the form of a Cookbook, with practical recipes for building web applications and explaining some of the more complex features of Laravel.

Who this book is for

The Laravel Application Development Cookbook is for PHP developers who are new to Laravel or development frameworks in general, as well as experienced Laravel developers looking to expand their knowledge. This book assumes that the reader has some familiarity with PHP.

Trusted by 375,005 students

Access to over 1 million titles for a fair monthly price.

Study more efficiently using our study tools.

Laravel Application Development Cookbook


Table of Contents

Laravel Application Development Cookbook
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. Setting Up and Installing Laravel
Introduction
Installing Laravel as a git submodule
Getting ready
How to do it...
How it works...
There's more...
Setting up a virtual host and development environment in Apache
Getting ready
How to do it...
How it works...
There's more...
Creating "clean" URLs
Getting ready
How to do it...
How it works...
There's more...
Configuring Laravel
Getting ready
How to do it...
How it works...
There's more...
Using Laravel with Sublime Text 2
Getting ready
How to do it...
How it works...
There's more...
Setting up your IDE to autocomplete Laravel's namespaces
Getting ready
How to do it...
How it works...
There's more...
Using Autoloader to map a class name to its file
Getting ready
How to do it...
How it works...
See also
Creating advanced Autoloaders with namespaces and directories
Getting ready
How to do it...
How it works...
There's more...
See also
2. Using Forms and Gathering Input
Introduction
Creating a simple form
Getting ready
How to do it...
How it works...
There's more...
See also
Gathering form input to display on another page
Getting ready
How to do it...
How it works...
See also
Validating user input
Getting ready
How to do it...
How it works...
See also
Creating a file uploader
Getting ready
How to do it...
How it works...
See also
Validating a file upload
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a custom error message
Getting ready
How to do it...
How it works...
There's more...
See also
Adding a honey pot to a form
Getting ready
How to do it...
How it works...
There's more...
Uploading an image using Redactor
Getting ready
How to do it...
How it works...
There's more...
Cropping an image with Jcrop
Getting ready
How to do it...
How it works...
There's more...
Creating an autocomplete text input
Getting ready
How to do it...
How it works...
There's more...
Making a CAPTCHA-style spam catcher
Getting ready
How to do it...
How it works...
3. Authenticating Your Application
Introduction
Setting up and configuring the Auth library
Getting ready
How to do it...
How it works...
Creating an authentication system
Getting ready
How to do it...
How it works...
See also
Retrieving and updating user info after logging in
Getting ready
How to do it...
How it works...
There's more...
See also
Restricting access to certain pages
Getting ready
How to do it...
How it works...
Setting up OAuth with the HybridAuth package
Getting ready
How to do it...
How it works...
Using OpenID for logins
Getting ready
How to do it...
How it works...
There's more...
Logging in using Facebook credentials
Getting ready
How to do it...
How it works...
There's more...
Logging in using Twitter credentials
Getting ready
How to do it...
How it works...
There's more...
Logging in using LinkedIn
Getting ready
How to do it...
How it works...
4. Storing and Using Data
Introduction
Creating data tables using migrations and schemas
Getting ready
How to do it...
How it works...
There's more…
Querying using raw SQL statements
Getting ready
How to do it...
How it works...
See also
Querying using Fluent
Getting ready
How to do it...
How it works...
There's more...
See also
Querying using Eloquent ORM
Getting ready
How to do it...
How it works...
There's more...
See also
Using automatic validation in models
Getting ready
How to do it...
How it works...
There's more...
Using advanced Eloquent and relationships
Getting ready
How to do it...
How it works...
There's more...
Creating a CRUD system
Getting ready
How to do it...
How it works...
There's more...
Importing a CSV using Eloquent
Getting ready
How to do it...
How it works...
Using RSS as a data source
Getting ready
How to do it...
How it works...
Using attributes to change table column names
Getting ready
How to do it...
How it works...
Using a non-Eloquent ORM in Laravel
Getting ready
How to do it...
How it works...
There's more...
5. Using Controllers and Routes for URLs and APIs
Introduction
Creating a basic controller
Getting ready
How to do it...
How it works...
Creating a route using a closure
Getting ready
How to do it...
How it works...
Creating a RESTful controller
Getting ready
How to do it...
How it works...
Using advanced routing
Getting ready
How to do it…
How it works...
Using a filter on the route
Getting ready
How to do it...
How it works...
There's more...
Using route groups
Getting ready
How to do it…
How it works...
Building a RESTful API with routes
Getting ready
How to do it...
How it works...
There's more...
Using named routes
Getting ready
How to do it...
How it works...
Using a subdomain in your route
Getting ready
How to do it...
How it works...
There's more...
6. Displaying Your Views
Introduction
Creat...

Table of contents

  1. Laravel Application Development Cookbook

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Laravel Application Development Cookbook by Terry Matula in PDF and/or ePUB format, as well as other popular books in Computer Science & Application Development. We have over one million books available in our catalogue for you to explore.