Announcing Building a Chatbot with Laravel and BotMan

Bots are the tools of the future, and they can be used for everything from customer support, all the way to offering productivity tools like scheduling or reminders. Many people live inside their messaging app of choice which makes bots feel comfortable, and a perfect fit for reaching them.

Today, we are happy to announce a brand new book, Building a Chatbot with Laravel and Botman, that is written by Joe Dixon the founder and CTO of ubisend, a company specializing in bot development.

“I’ve been building chatbots for over two years. Being a brand new technology, there was very little in the way of best practice available when I started, and I still feel that to be the case now.”, Joe said on the reason he wanted to write this book, “I want to help those who don’t know where to start.”

Chatbots are taking the world by storm, and Gartner Research is estimating that by 2020, the average person will have more conversations with their bot than with their spouse.

As a developer, it would be great to have the skills needed to build custom bots, and this book walks you through a tutorial to create your own chatbot. You’ll learn how to effectively plan, build, test and deploy your very own chatbot while covering the core concepts of chatbot development.

Buy the book now through Sunday for the special launch price of $15! Get ahead of the curve and learn how to build a chatbot today, using the tools you already know.

Buy Now

Review: Refactoring to Collections

“Never write another loop again.” A strong promo sentence used by Adam Wathan to market his Refactoring to Collections book, but does it hold the promise? Well, together we will explore how close that claim is to reality.

If you are a Laravel developer, chances are you’ve heard about the collection pipeline before. While I use it a little in my projects I hadn’t realized the possibilities of this approach until I read Refactoring to Collections. It brought me to another level of thinking about utilizing the power and capabilities of functional programming.

Imperative Versus. Declarative Programming

At the beginning of the book, Wathan discusses the difference between imperative and declarative programming and why he prefers the declarative approach. Instead of writing your code in an imperative way (using intermediate variables, loops, conditional statements, and focuses on implementation details) Adam advises you to take a look at the opposite style which focuses on telling the computer what we need it to accomplish instead of caring about implementation details.

Take a look at the following example:

// Imperative Programming
function getUserEmails($users)
    $emails = [];

    foreach ($users as $user) {
        $emails[] = $user->email;

    return $emails;
// Declarative Programming
function getUserEmails($users)
    return $users->map(function ($user) {
        return $user->email;

Notice how we didn’t need to use loops or intermediate variables in the declarative programming way? Of course, this is a very simple example to show you the basics; the book covers far more complex and useful examples.

The Journey

Refactoring to Collections outlines higher-order functions and their usefulness. It also covers some fundamental higher-order functions like Each, Map, Filter, Reduce, etc. and their implementation.
Wathan has also done a good job explaining when to use one higher-order function over another. He gives you some good indicators to help you choose which higher-order function will best meet your needs.

Next, the book discusses the problem of “inside-out” code, the difficulty of reading it, and introduces you to the solution: the collection pipeline which reads from left to right.

In one my favorite parts of the book, Wathan goes through an implementation of the simple Collection class and makes it possible to use collections in place of arrays and make them countable.

The last part of the book is a walkthrough in a lot of practical examples. Wathan does an awesome job at choosing real-world problems you may encounter in your apps and shows how to solve these problems by using imperative programming, then refactor the solution to declarative programming to show you how declarative programming will make your code more simple and easy to read.

Also, all of the examples are provided as screencasts so you can see Wathan refactor and solve the examples problems step by step, which is my preference..

Honestly, while I advanced through the examples of the book, I was amazed by the process Wathan invented for solving these problems, and I’m sure you will also be surprised by the advanced nature and complexity of the examples..

A Lot to Learn

The nice thing about this book is that you will have a lot to learn, not just about collections. Personally, I learned some great refactoring techniques, and even some PHP tricks, like using forEach to iterate over object public properties.

Even if you aren’t a PHP developer, you can learn from this book as its concepts can be applied to other languages easily.

As always, with any programming skill, you must practice these new ways and techniques and make it part of your everyday workflow to make it click and stick with you. Luckily, the book comes with exercises divided into three categories: Beginner, Intermediate, and Pro to practice what you learned. The solutions for these exercises are included so you can compare them with your solutions and benefit, my advice is not read the solutions until you try to solve the exercises by yourself as the practice a key way can’t be avoided in learning new programming skills.


Another wonderful aspect of the book is the amount of effort Wathan has put into every aspect, from the easy to understand writing style to divide the problems into steps and tackling them one by one to achieve the final solution. The quality of the screencasts and seeing Wathan do the refactors live will give you a pleasurable learning experience.

Also, in many examples, I appreciated the effort Wathan put into searching other languages for collection pipeline methods to reach the optimal solution and implement these methods in PHP like he did with the chunkBy and sliceBefore methods.

Even the overall style of the book—the fonts and syntax highlighting color scheme for code blocks—were great choices.

He also created his own Markdown syntax and processing layer for syntax highlighting lines in code blocks and pointed out specific pieces of code to draw the attention to it and gray out the remaining lines.

Here is an example from the book, notice the syntax highlighting and grayed out lines:

And take a look at the beautiful diffs he uses to show the changes happening to code blocks:

I like it!


The first hope is PHP accepting the Arrow Functions RFC, which will make using the collection pipeline style easier and more beautiful.
Take a look at this example:

// Before
function getUserEmails($users)
    return $users->map(function ($user) {
        return $user->email;

// After
function getUserEmails($users)
    return $users->map(fn($user) => $user->email);

Another hope is for Refactoring to Collections to be updated to reflect the new changes introduced to the Laravel framework after the publication of the book. For example, the book talked about how to implement a collection pipeline method called pipe, but a pull request for this method was merged in Laravel, so it would be better to reflect this update and mention it in the book.

The book could also be updated to reflect the new higher order messaging for Collections feature which was introduced in the Laravel 5.4 release; it will make the book code examples look more intuitive and more beautiful.

Take a look at this example:

// Before
$employees->reject(function($employee) {
    return $employee->retired;

// After using Higher Order Messaging for Collections

Much better!

And, if there was a price drop for at least in the first two packages of the book, that may encourage more developers to buy it.

Refactoring to Collections has three tiers of pricing. The Bare Essentials package which includes the book and exercises at $39. The Premium Training Package which includes the screencasts at $79. The Complete Reference Package which includes the source code of an example Laravel application called Nitpick CI at $179.

That’s it; if you want to learn a new nice way of programming that’s easier to read and more expressive to a look at Refactoring to Collections.

Review of Test-Driven Laravel

I’ve been programming for close to a decade, and I’m constantly trying to find ways so to improve my skill set to be able to keep up with the ever-changing landscape of technology. The one area I’ve always wanted to improve in has been testing.

I’ve joked on Twitter about using my HasAdamWathanOnTelegramForSupport trait to get help with things that were tricky to test. So when Adam announced at Laracon that he was creating a course on building real-world applications with TDD, I was really excited to see where it would go.

Over the past couple of months, I’ve been lucky enough to preview the course as the lessons get finished. It’s been really helpful because I’ve been working on a large, complex application, and I’ve been able to apply the things I’m learning immediately in my day-to-day work.

I’ve learned so much from this course already; everything from what tests to write first, how to refactor my tests to make them faster, starting new features with a failing test, and simplifying my tests with factories and states. The most helpful part so far has been learning how to add test coverage for the parts of my app that need to communicate with external services, such as Stripe. At this point, I’m comfortable enough writing tests that I’m actually adding new features to my project test-first, before writing any actual code.

But I’ve also learned about more than just the mechanics of testing. I’ve learned how to evaluate my code and find ways to improve it through refactoring. If you’ve seen Adam’s talk Chasing “Perfect”, imagine that level of detail applied to an entire app. I’ve learned a lot about testing from the course, but I’ve learned just as much about writing well-designed object-oriented code. It’s definitely a course on building applications with TDD, not just a course on testing.

Test-Driven Laravel has been a game changer for me, and I’m looking forward to watching the rest of the lessons as they become available. But I’m even more excited for everyone else to get their hands on the course, so we can all get better at testing as a community.

New Book: Laravel Up and Running

Matt Stauffer who has been blogging about Laravel since the 5.0 release, the host of the Laravel Podcast, and partner and technical director at has been working on a new Laravel book, Laravel: Up & Running, published by O’Reilly.

Here are a few of the topics this book covers:

  • Blade, Laravel’s powerful custom templating tool
  • Tools for gathering, validating, normalizing, and filtering user-provided data
  • Laravel’s Eloquent ORM for working with the application’s databases
  • The Illuminate request object, and its role in the application lifecycle
  • PHPUnit, Mockery, and PHPSpec for testing your PHP code
  • Laravel’s tools for writing JSON and RESTful APIs
  • Interfaces for file system access, sessions, cookies, caches, and search
  • Tools for implementing queues, jobs, events, and WebSocket event publishing
  • Laravel’s specialty packages: Scout, Passport, Cashier, Echo, Elixir, Valet, and Socialite

It’s available today as an e-book from O’Reilly and the paperback version will begin shipping in a few days. You can pre-order today from Amazon.

With the book now complete and heading off into printing I had the opportunity to ask Matt a few questions about the book and his experiences as a first-time author.

How excited are you now that the book is complete and ready to start shipping?

Eric. My friend. I started writing this book in July of 2015. I wrote the last chapter (other than Laravel 5.3 additions) in May 2016. I updated the Laravel 5.3 sections in August. I’ve spent the last three and half months going back and forth with O’Reilly on edits and reviews and indexes and draft covers.

I’m not saying I’m more excited about this book releasing than I was about the birth of my children. But. It does sort of feel like my baby. And I cried like a little child when each of my kids came into the world.

So, to answer your question, I’m excited.

What initially inspired you to want to write a book on Laravel?

I’d tossed around the idea of writing a book for a while. To be honest, I was more strongly considering a softer skills book. But then O’Reilly approached me about writing a book about Laravel, and it was obvious instantly how great this could be.

There are a few things that have inspired me in this process. One is how much I love teaching. I love it. I love blogging and mentoring and speaking at conferences. So this book is basically just the permission for me to do that for 440 pages. It’s incredible. It’s a rush, to imagine that someone will pick up this book not knowing Laravel and finish it able to write significant applications. I get to help with that.

I’m also incredibly excited to see Laravel move into more spaces. O’Reilly has access to academia and tons of enterprise settings that will help Laravel move into those spaces.

And finally, I love the idea of having a single resource to point people toward for starting their journey as a Laravel developer. I love telling people to subscribe to Laravel news and sign up for Laracasts for their ongoing education, but now I’ll have something to point them to as the place to get started.

Did you have a certain audience in mind while you were writing it?

I have two audiences in mind. First, the primary audience is a PHP developer who’s never worked in Laravel before, or just gotten started. The book starts at the tools you need on every site and expands from there; that means many readers will break off after the first or second or third chapters and get started coding, and return back to the book as their needs grow.

The book doesn’t expect you to have any knowledge of Laravel or how it works, which is why it’s great for a developer new to Laravel.

However, I had a secondary goal. As I wrote the book, I learned a ton about Laravel, and I realized that I could write the book in a way that would also provide benefit to the most experienced of Laravel developers. So I set out to write it in a way that exposed some little secrets of the code base, explaining how things work that so many of us just expect to “just work.”

Writing a book on a framework means you have to dig deep into the code, did you learn a lot of new things about Laravel?

I couldn’t even begin to list off the things I learned while writing the book. I read through every single line of the Laravel / Illuminate codebases many times writing the book, and followed all sorts of logic and dependency chains up and down. It was fascinating, and I think it really impacted how I code.

I wrote up a few fun things I learned in a post on my blog title Things I didn’t know Laravel could do. But that’s just the tip of the iceberg. It’s absolutely incredible how much you learn.

The parts of the book that made me move the slowest were the features I don’t use day-to-day. When’s the last time you wrote a many-to-many polymorphic relationship? I can’t tell you the last time I did. But in order to write this book with integrity, I had to become an expert on it–which meant not only reading the docs and the source, but also spinning up sample apps using each feature to make sure it worked the way I expected, and to make sure I caught any gotchas. It was intense, but yes: I learned a ton.

When you started writing did you expect it to take as long as did?

Our original plan was for it to take nine months. They wanted me to say six, but I knew my life was busy and shot for nine.

There are a few reasons it took so much longer. First, it was just a lot harder to find long uninterrupted blocks of time to write than I had ever expected. Second, what was intended to be a 250-page book turned out to be a 440-page book. The length is just right, so I’m glad it ended up as it did, but that definitely left it taking longer than I originally expected. And third, we planned the final delivery of the book around the release of Laravel 5.3, so when that came out a few months later than I expected, that meant the book had to come out a few months later as well.

What tools and apps did you use to create the book with?

O’Reilly uses an internal system called Atlas, which means I used AsciiDoc (a cousin of Markdown) and Git.

I wrote the entire book in Sublime Text, in AsciiDoc, versioned with Git. I pushed up to their servers and clicked a button on their site and waited for a few minutes every time I needed a PDF preview.

I created a few graphics in PhotoShop, but thankfully their editors fixed those up for me.

What was the hardest part of writing the book?

The hardest part of writing the book was working through sections that are dense–for example, the initial DB and Eloquent spec require you to cover an incredible amount of methods, one after another–without being boring and without just mirroring the docs.

Some sections were so easy–when there’s a lot of thinking and architecture and when I work with it every day. The section on the container is one of my favorites in the book, and it just flowed out without hardly any work. Not every section was like this.

If you started a new book today, what would you do differently?

If I started this same book again today, I can’t say I would do much differently. I’m very happy with how it turned out. Maybe I would time all the time I spent writing it so I had a really good understanding of how many hours I actually put into it.[a]

If I started a new book today, I’d self-publish. Not because that’s better, but because I’ve gone the traditional publisher route. I want to do it myself next time around. Write the book, publish it, send it out, collect my own payments, handle my own everything, release my own book with my own typos. Again–not because I didn’t enjoy this. But because I want something different.

Why should people buy Laravel Up & Running?

There are a few reasons people should buy Laravel: Up & Running. First, it’s the clearest and most comprehensive book about Laravel in existence. If you want to learn Laravel, this will absolutely be the best way to learn it, from scratch, as quickly as possible.

Second, I poured my heart into this. I’ve definitely let the blog slack a little bit–I’m very sad about this, and really hope to remedy that as quickly as possible. If you like my blog or my podcasts, a lot of that energy has gone into this book. I’ve worked hard to make it as valuable as possible.

Third, it has a gemsbok on the cover. A gemsbok. Do you know what a gemsbok is? I didn’t know what a gemsbok is. It’s fascinating. Don’t you now want a book with a gemsbok on the cover? I thought so. Boom. There you go.

Learn Laravel with Code Smart by Dayle Rees


Dayle Rees today launched his newest Laravel book, Code Smart.

Laravel: Code Smart is the third installment in my ‘Code’ series of books for the Laravel framework. The ‘Code’ books have thousands of readers and are considered by many to be the most effective method of learning the Laravel framework. As always, my books serve as both an introduction for beginners, and reference material for more experienced developers. I promise that you’re going to love it! You’ll be writing Laravel applications in no time.

You can use the coupon code LAUNCH to save 10% today only.

Learn PHP with PHP Pandas

It can be a daunting task to try and learn a new programming language and the new book “PHP Pandas” by Dayle Rees aims to teach you the basics of PHP in a fun and informative way.

This book is the third by Dayle with the previous two being Laravel specific, but they all carry the same fun style of writing. To give you an example here is an excerpt about the glamorous developer lifestyle:

Why did you decide to pursue development? No, wait! Let me guess. You saw a rockstar PHP developer swagger out of a Limousine into one of New York’s hottest night spots, order 5 bottles of Cristal and spend the evening chilling with Jay-Z and the ghost of Tupac.

This book is written for absolute beginners but still touches on all the important areas of PHP. So even developers with more experience can refresh your skills and maybe pick up a few new tips and tricks.

PHP Pandas Features

PHP Pandas is 182 pages and 28 chapters starting with installing PHP through the basics and up to Scopes, Traits, Namespaces, Interfaces, Inheritance, and more.

You can get a copy and find out more information about PHP Pandas on Leanpub.

Laravel and E-Commerce Book

Yesterday I officially announced a new book that I’ve been co-authoring with W. Jason Gilmore.

Easy E-Commerce using Laravel and Stripe is a fun, hands-on guide to building an online store. You’ll learn by doing, following along with the development of a store for a fictional lawn care and landscaping company.

The book is divided into five chapters and each chapter represents a new “phase” of the project which introduces a fundamental concept associated with building an online store. Here is what each chapter covers:

Chapter 1. Creating the We Dew Lawns Website

In this opening phase you’ll be tasked with the creation of a fairly simple Laravel-driven website that tells prospective customers more about the business, and offers a user-friendly contact form which sends inquiries to the company assistant, Patty Organo.

To suit this requirement, you’ll work through the creation of a new Laravel 5 website complete with Less, Elixir, and Bootstrap integration. You’ll also create a home and company bio pages, a site-wide layout, and a contact form.

Chapter 2. Integrating User Accounts

Following a successful launch of the first phase, Mr. McDew would like to begin building a customer mailing list. To entice individuals into handing over their valuable e-mail addresses he would like to offer registered users access to downloadable coupons which they can then apply to lawn care services. In this chapter, you’ll integrate and customize user registration and authentication features into the site, and create a restricted area of the site accessible only to authenticated users.

Chapter 3. Integrating Stripe and Creating a Product Catalog

With the site launched and the mailing list continuing to grow, Mr. McDew’s ambitions have now turned to online sales. He would like to create a simple online store for selling products such as lawn mowers and gardening tools. In this chapter, you’ll integrate Laravel Cashier to easily and securely accept credit card payments. You’ll also learn how to create a restricted administration console complete with a product catalog manager so Mr. McDew and his team can easily add and update products.

Chapter 4. Selling Electronic and Physical Products

With Stripe and Laravel Cashier integrated, and your product catalog created, it’s time to begin selling products! In this chapter you’ll learn how to sell electronic (downloadable) and physical products through your website. We’ll show you how to integrate the secure Stripe “Buy” button and modal, complete transactions using Cashier, and generate one-time URLs for automated product downloads. We’ll also talk a bit about shipping and sales tax complexities, and identify a few popular associated resources.

Chapter 5. Selling Subscriptions

In this final project phase, Mr. McDew sets his sights on selling lawn care subscriptions. In this chapter you’ll learn how to integrate Stripe’s recurring billing service into the We Dew Lawns website, and sell a number of lawn care service tiers to area customers. You’ll also learn how to configure webhooks to autonomously receive and respond to various subscription-related events.

Learn how to implement subscriptions, digital downloads, one-off purchases, customized receipts, and so much more! Plus it’s published on Leanpub so you’ll get free updates for life. Visit the official site for more details and to get your copy today.

Master Sublime Text with Sublime Text Power User

Sublime Text is one of the most popular editors for developers. It has tons of power, extremely light weight, and with a package system the customizations are limitless. I made the switch to it from TextMate years ago and even after all that time I’ve never truly mastered the editor.

Wes Bos understood that problem and wrote a book on the subject to help you not only learn your way around but to save you time. Sublime Text Power User covers everything from your first steps, to themes, shortcuts, macros, to tips and tricks.

I got to sit down with Wes and find out a little more about the book, the videos, and some of the ways he uses Sublime Text.

When I first tried Sublime Text the goto was life changing for me. What is your favorite Sublime Text feature?

Mine is very similar – I love the command palette and the goto anything command – these two windows allow you to access any command, file, line, function, method or selector in your entire project. I was previously a heavy user of the mouse and the find option – now I rarely use those to move around my code – there are much better ways!

My big complaint with Sublime Text is I can’t ever remember the shortcuts. Do you offer advice on tricks to memorize these?

As with anything, it takes a little practice. My tip for people is that when you do something manually with the mouse, stop and spend the 30 seconds that it takes to re-learn the shortcut. This will happen 3-4 times before you start to get the hang of it. The brain is really powerful and all it takes to train new skills is a little persistence and repetition.

With the Build systems, Git integration, and Linting you can get pretty close to a heavy IDE.

That is what makes Sublime Text so great – not everyone needs a heavy IDE, but some of the more commonly used features are totally available without slowing down the editor. The community has been great at making packages that extend the features of the editor.

Besides giving just an overview of Sublime Text what other goals does the book have?

My hope with this book is to uncover some of the most useful parts of Sublime Text that you can immediately implement into your workflow. There are so many features – big and small – that just don’t get enough usage. Many readers come back after reading the book lamenting how they wished they had known all this stuff sooner.

Time is a huge factor in staying productive. Your editor is the one tool you spend most of yours in and you should invest in optimizing your workflow skills. You’ll benefit from them everyday. Wes has some of the best insights in workflow of anyone I know. — Addy Osmani

The other goal of the book is to make you more productive – it pays for itself by not only making you a faster developer, but a better one. I want to help you increase the quality of the code that you write.

What Sublime Text theme and style are you currently using?

Sublime Text Cobalt Theme

Over the past 5 years, I’ve been working on one called Cobalt2 which is a constantly evolving, easy on the eyes blue color scheme with good contrast for things like keywords and methods. It also comes with a theme that does custom sidebar icons which is something relatively new to Sublime Text!  

Besides the book, you offer a book + video package. Can you tell us about the advantage of getting both?

There are some things that are hard to explain in text, and make so much sense in a video. I’ve always loved and learned a lot by watching other developer code and use their editor. The videos are a perfect companion to the book as well as they serve as a great reference for when you need a quick refresh.

If you’d like to learn more about Sublime Text and learn to save time with your editor be sure and check out Sublime Text Power User. Also as a bonus if you buy it today take $10 with the coupon LARAVEL

Learn Laravel 5 with Easy Laravel


Easy Laravel is a new book by W. Jason Gilmore, focusing entirely on the brand new Laravel 5. Easy Laravel features 8 chapters and over 200 pages to help you learn Laravel 5 quickly by building a real world project.

Jason has spent the last 15 years using PHP, during this time he’s written seven PHP books. Including the bestseller, “Beginning PHP and MySQL, Fourth Edition”, that has been in print more than 10 years. He has a gift of explaining things clearly in a very nice style.

Special Offer – Use the coupon code laravel-news to save 10% off the purchase price.

Author Q & A

I reached out to Jason to ask him about the book and what follows is a Q&A session we had:

What made you decide to write a Laravel book?

The Laravel framework is one of the most exciting developments to come along in PHP community in a long time. Creator and lead developer Taylor Otwell has done a great job incorporating unique features alongside tried-and-true third party packages to produce a framework that is incredibly easy to use. The PHP language has always been heralded for helping developers get things done quickly, and Laravel really seems to suit that sentiment.

So with this in mind, after working on a few Laravel projects I knew this was something I really wanted to write about. When work on Laravel 5 was announced (at the time identified as 4.3), I shifted the book writing process into high gear because it became increasingly obvious fellow developers were going to want to learn all about the exciting new features, and was lucky enough to have wrapped up a respectable first version on the very day Laravel 5 was released.

What was the most enjoyable part of creating the book?

The most enjoyable part of writing Easy Laravel 5 was undoubtedly the early release process I employed to put an early draft of the book in front of readers as early as possible. This gave readers the opportunity to preview the material and learn more about what was coming in Laravel 5 at a significant discount to the final cost of the book, and provided me with a great deal of early feedback from readers eager to help me improve various aspects of the book. This was a lot of fun, and definitely something I’ll do again.

It was also fun to repeatedly build new Laravel 5 test projects as the framework development continued. I probably built upwards of 100 prototypes over the past few months, along the way watching the framework stabilize and become feature complete.

What is your favorite new Laravel 5 feature and why?

This is a difficult question, because I like so many facets of Laravel 5. I think Elixir has a lot of promise because it can automate many tedious tasks that I’d otherwise not prefer to think about. I also really like the Command Scheduler, as it makes rigorous task execution so easy. The new configuration approach (via phpdotenv) is really great too. Hmmm this answer is really starting to grow, perhaps I should just say all of them are my favorite!

Highlights in Easy Laravel

Here are some of the highlights Easy Laravel covers:

  • Embraces Laravel best practices and the most popular third-party packages to help you become insanely productive fast.
  • Extensive discussion on test integration so you can be confident your code is rock solid.
  • Helps you to master the Eloquent ORM and deftly manipulate and navigate your model relationships.
  • Explains how to effectively manage your project CSS and JavaScript, and easily integrate Bootstrap.
  • Includes a thorough introduction to forms integration and validation.
  • Shows you how to efficiently and effortlessly deploy your Laravel applications.

Easy Laravel will give you the knowledge needed to build your first app with Laravel. See the table of contents below for more information on each chapter:

Chapter 1. Introducing Laravel

In this opening chapter you’ll learn how to create and configure your Laravel project both using your existing PHP development environment and Laravel Homestead. It also covers configuring your environment for effective Laravel debugging, and how to expand Laravel’s capabilities by installing several third-party Laravel packages that promise to supercharge your development productivity. Finally, you’ll conclude the chapter with an introduction to PHPUnit, showing you how to create and execute your first Laravel unit test!

Chapter 2. Managing Your Project Controllers, Layout, Views, and Other Assets

In this chapter you’ll learn how to create controllers and actions, and define the routes used to access your application endpoints using Laravel 5’s new route annotations feature. You’ll also learn how to create the pages (views), work with variable data and logic using Blade, and reduce redundancy using layouts and view helpers. Next you get introduced to Laravel Elixir. The chapter concludes with several examples demonstrating how to test your controllers and views using PHPUnit.

Chapter 3. Talking to the Database

In this chapter, we’ll turn our attention to the project’s data. You’ll learn how to integrate and configure the database, create and manage models, and interact with the database through your project models. You’ll also learn how to deftly configure and traverse model relations, allowing you to greatly reduce the amount of SQL you’d otherwise have to write to integrate a normalized database into your application.

Chapter 4. Model Relations, Scopes, and Other Advanced Features

Building and navigating table relations is a standard part of the development process even when working on the most unambitious of projects, yet this task is often painful when working with many web frameworks. Fortunately, using Laravel it’s easy to define and traverse these relations. In this chapter, I’ll show you how to define, manage, and interact with one-to-one, one-to-many, many-to-many, has many through, and polymorphic relations. You’ll also learn about a great feature known as scopes which encapsulate the logic used for more advanced queries, thereby hiding it from your controllers.

Chapter 5. Forms Integration

Your application will almost certainly contain at least a few web forms, which will likely interact with the models, meaning you’ll require a solid grasp on Laravel’s form generation and processing capabilities. While creating simple forms is fairly straightforward, things can complicated fast when implementing more ambitious solutions such as forms involving multiple models. In this chapter I’ll go into extensive detail regarding how you can integrate forms into your Laravel applications, introducing Laravel 5’s new form requests feature, covering both Laravel’s native form generation solutions as well as several approaches offered by popular packages. You’ll also learn how to test your forms in an automated fashion, meaning you’ll never have to repetitively complete and submit forms again!

Chapter 6. Integrating Middleware

Laravel 5 introduces middleware integration. In this chapter I’ll introduce you to the concept of middleware and the various middleware solutions bundled into Laravel 5. You’ll also learn how to create your own middleware solution!

Chapter 7. Authenticating and Managing Your Users

Most modern applications offer user registration and preference management features in order to provide customized, persisted content and settings. In this chapter you’ll learn how to integrate user registration, login, and account management capabilities into your Laravel application.

Chapter 8. Deploying, Optimizing and Maintaining Your Application

“Deploy early and deploy often” is an oft-quoted mantra of successful software teams. To do so you’ll need to integrate a painless and repeatable deployment process, and formally define and schedule various maintenance-related processes in order to ensure your application is running in top form. In this chapter you’re introduced to the Laravel 5 Command Scheduler, which you can use to easily schedule rigorously repeating tasks. Also talk about optimization, demonstrating how to create a faster class router and how to cache your application routes. Finally, I’ll demonstrate just how easy it can be to deploy your Laravel application to the popular hosting service Heroku, and introduce Laravel Forge.

Free Companion Video

Included with the purchase price is a companion video which shows you how to create a Laravel 5 project using Composer. This is useful if you’re already working within an established PHP development environment and would prefer to not use Homestead. Also a brief tour of the Laravel 5 project directory structure, identifying the new locations of the configuration files, project controllers, and views. Next have a look at the routing file before finally using PHP’s built-in web server to view the default project splash page.

How to order

As you can see this book is designed to help you get up to speed with Laravel 5 and it does a great job covering all the little details. If you’d like to pick up a copy you can buy it now from Gumroad. With the purchase, you get the free video mentioned above as well as free updates for life. The book formats include EPUB, MOBI, and PDF with the ability to send directly to your device.

Save 10%

As a Laravel News exclusive by any of the book packages and you can use the coupon laravel-news to save 10% off the total price.

Get your copy of this book. You’ll be up to speed with Laravel in a very short time.

New Book – Servers For Hackers

Servers for Hackers is a new book by Chris Fidao. For those that are not familiar with it, it started out as a wildly successful newsletter. Each issue includes tips and tricks about server administration written toward developers. From the success of this Chris is releasing a new package of three products, an e-book, case studies, and tutorial videos.

I feel I am a perfect match for this book because I honestly loathe server administration. I know enough of the basics to be dangerous and this part of the tech stack never grabbed my attention.

Cloud servers are now very affordable and running your own has never been easier or cheaper. Getting up to speed on basic server administration is an important attribute not only for my job but also for my personal projects. That is why I’m excited about this book.

Servers for Hackers the e-book covers the following topics:

  • Virtualbox and Vagrant
  • Security
  • Package Managers mostly APT with Ubuntu
  • Permission and User Management
  • Webservers – HTTP, DNS, Apache, Nginx, and Multi-Tenancy
  • SSL
  • Multi-Server Environments – Load Balancing with both Nginx and HAProxy
  • Logs – Logrotate and Rsyslog
  • File management, deployment, and configuration – Managing files, Auto-Deploy with GitHub, and Ansible
  • SSH – Config and Tunneling
  • Monitoring Processes
  • Serving Static Content locally

Each of the sections goes into really great detail and steps you through the workflow of setting everything up. Since getting an early copy I’ve been using this book as a resource to refer back to when I get stumped. It’s structured in such a way that referencing later is easy. I think it’s well worth the price of $34.99.

As I mentioned more packages are also available. For an extra $10 you can get a second ebook with case studies that cover some common use cases that you may run into. This includes items like the first steps on a server, nginx with multiple sites, MySQL replication, Python and uWSGI, and Queues and Workers.

Then for an additional $20 you can get video tutorials which include:

  • Ansible (similar content to the book but shows debugging steps)
  • Purchasing and installing real normal and wildcard SSLs, including testing the install
  • Vagrant and setting up wildcard sudomains that automatically map to directory, using, and some common gotchas
  • Setting up and using supervisord
  • and more planned to come…

Well worth the extra few dollars to have these available when you need them.

One final benefit is Servers for Hackers should have lasting value as Ubuntu has LTS for 4 years. Unlike lots of tech style books you can buy it today and it will not be outdated for a long time. That’s a huge bonus!

As I mentioned in the beginning I’m a perfect match for the content and I feel like this book was written specifically for me. I highly recommend it. So many great topics that are explained clearly. Do yourself a favor and pick up a copy. I don’t believe you will be disappointed.

Here is the site to go buy it.