Laravel 4 Cookbook

What This Book Teaches I’m writing this book (and the tutorials) in the hope that people can learn the things I have about Laravel 4. It’s not meant as a replacement for any of the great Laravel books, but instead as a complement to the resources, documentation and framework. This book teaches various aspects of … Continue reading “Laravel 4 Cookbook”

Laravel 4 Cookbook
Christopher Pitt and Taylor Otwell

What This Book Teaches

I’m writing this book (and the tutorials) in the hope that people can learn the things I have about Laravel 4. It’s not meant as a replacement for any of the great Laravel books, but instead as a complement to the resources, documentation and framework.
This book teaches various aspects of Laravel 4 implementation, configuration and usage; as part of separate projects. The idea is not to demonstrate the only or best way to create any of these projects.
It’s not to show the only or best way to use Laravel 4. It’s simply a different (and subjective) kind of documentation to the modularised version found at: While this book touches on in the installation and hosting of Laravel applications; it’s not an
exhaustive reference for how to do these things. There are some instructions; which should be enough to get you up and running, but it assumes you are familiar with how things like LAMP (Linux, Apache, MySQL and PHP) work and are capable of installing and maintaining them.

Why Write This Book
I was learning how to use Laravel 4 more effectively, and found some subjects which I felt were worth sharing. I picked Medium (which later turned out to be a huge pain) and started putting a tutorial together. A few hours later I hit publish…
Then @laravelphp retweeted a link to the article. I think I spent the rest of the day just watching stats. The tutorial hit Medium’s home page. It turns out there are a lot of people who wanted to know about Authentication (in Laravel), and just needed to be exposed to the article through @laravelphp’s promotion of it.
Since then; I have been releasing a tutorial every two weeks.
The book grew out of the realisation that; while loads of people were reading the tutorials on Medium, some people weren’t happy with the platform.
There are many compelling reasons for me to keep on using Medium to host the tutorials. I don’t want to host my own thing because uptime is important, and outages in the night add years onto my life. The simple statistics and text formatting are also great.
I want to stay on Medium, but I also want people to want to read the tutorials and learn from them on other platforms. The book allows both of these things, as well as an important third thing…
The book is also intended as a means to give back to Laravel; in particular the invaluable work of Taylor Otwell. To this end, I have committed to give half of all sales to Taylor. The tutorials will always be free on Medium, and their content will mirror the chapters of this book (with obvious repetition omitted), but by purchasing this book you are helping to fund future Laravel development from him and tutorials from me.

Laravel Application Development Cookbook

Laravel Application Development CookbookLaravel has become one of the fastest growing PHP frameworks ever. With its expressive syntax and excellent documentation, it’s easy to get a fully functioning web application up-and-running in very little time. Additionally, the use of modern PHP features makes Version 4 of Laravel very easy to customize to our own needs and also makes it easy for us to create a highly complex site if need be. It’s a perfect blend of the simple and advanced.
This book covers merely a fraction of all that Laravel is capable of. Think of it more as a starting point, with code examples to get things working. Then customize them, add to them, or combine them to create your own applications. The possibilities are endless.
One of the best things about Laravel is the community. If you’re ever stuck on a problem and doing a Google search isn’t helping, there are always people willing to help out. You can find helpful community members on IRC (#laravel on Freenode) or the forums ( or you can contact the many Laravel users on Twitter.
Happy Laravel-ing!

What this book covers
Chapter 1, Setting Up and Installing Laravel, covers various ways to get Laravel up-and-running.
Chapter 2, Using Forms and Gathering Input, shows many ways to use forms in Laravel. It covers using Laravel’s form class as well as some basic validation.
Chapter 3, Authenticating Your Application, demonstrates how to authenticate users. We’ll see how to use OAuth, OpenId, and various social networks for authentication.
Chapter 4, Storing and Using Data, covers all things data, including how to use data sources other than a MySQL database.
Chapter 5, Using Controllers and Routes for URLs and APIs, introduces various routing methods in Laravel and how to make a basic API.
Chapter 6, Displaying Your Views, demonstrates how views work in Laravel. We’ll also incorporate the Twig templating system and Twitter Bootstrap.
Chapter 7, Creating and Using Composer Packages, explains how to use packages in our app as well as how to create our own package.
Chapter 8, Using Ajax and jQuery, provides different examples of how to use jQuery in Laravel and how to make asynchronous requests.
Chapter 9, Using Security and Sessions Effectively, covers topics about securing our application and how to use sessions and cookies.
Chapter 10, Testing and Debugging Your App, shows how to include unit testing in our app with PHP Unit and Codeception.
Chapter 11, Deploying and Integrating Third-party Services into Your Application, introduces a number of third-party services and how we can include them in our application.

CodeIgniter 2 Cookbook

CCI2CookbookAs a developer, there are going to be times when you’ll need a quick and easy solution to a coding problem. CodeIgniter is a powerful open source PHP framework which allows you to build simple yet powerful full-feature web applications.

CodeIgniter 2 Cookbook offers many easy-to-use, easy-to-integrate, and easy-to-adapt recipes using HTTPS, image manipulation, cookie acceptance, form validation, and so on. It is a great
resource for 2 AM problems.

What this book covers
Chapter 1, CodeIgniter Basics, takes you through CodeIgniter’s download and installation, basic configuration, and so on.
Chapter 2, User Management, focuses on building a basic CRUD interface for managing users.
Chapter 3, Creating E-commerce Features, explores the use of the CodeIgniter Cart class to create a simple storefront, allowing a customer to add items to the cart and checkout.
Chapter 4, Email, HTML Table, and Text Libraries, focuses on sending e-mails using the CodeIgniter Email library, creating interactive tables, and using a few handy HTML functions.
Chapter 5, Managing Data In and Out, deals with form validation, writing files to disk, confirming cookie acceptance from the user, and so on.
Chapter 6, Working with Databases, covers the usage of basic Active Record functions, exporting data from a database query binding, and most of what you might need to work with databases.
Chapter 7, Creating a Secure User Environment, covers escaping user input, switching to and from HTTPS in CodeIgniter, and so on.
Chapter 8, Calendaring, Right Place, and Right Time, deals with creating an interactive calendar that you can add appointments to using fuzzy dates and calculating a person’s date of birth (for age verification)
Chapter 9, Extending the Core, focuses on using the language class and switching languages on the go, creating hooks, uploading files with FTP, and extending your controllers with MY_Controller.
Chapter 10, Working with Images, deals with using the CodeIgniter image manipulation library to crop, rotate, and add watermarks to images and adding CAPTCHA validation to forms.
Chapter 11, SEO, Caching, and Logging, deals with caching data from a database, using the CodeIgniter routing methods to alter and amend how URLs are displayed in a browser’s address bar, and logging errors and other activities throughout your application.

Yii Application Development Cookbook

YiiThe Yii framework is a rapidly growing PHP5 MVC framework often referred to as Rails for PHP. It has already become a solid base for many exciting web applications such as and can be a good base for your developments, too.

This book will help you to learn Yii quickly and in more depth for use in for your developments. Yii Application Development Cookbook will show you how to use Yii efficiently. You will learn about taking shortcuts using core features, creating your own reusable code base, using test driven development, and many more topics that will give you a lot of experience in a moderate amount of time.