Laravel and AngularJS
Minimum price
Suggested price

Laravel and AngularJS

Learn how to build apps with AngularJS in the client and Laravel on server

About the Book


  • Laravel 5.1
  • AngularJS: 1.4.4
  • Bootstrap: 3.3   (4 soon)
  • jQuery: 2.1.4

The main objective of this book is to address the best web development technologies on the market today. On the web, we are always splitting the systems development into two parts: server and client.

On the server, we will cover the programming language PHP 5.4, and the framework Laravel, in addition to the MySql database. We chose Laravel because it is a simple and powerful framework, with a growing acceptance in the market.

On the client, we have the Javascript language, which has consolidated its position as the best programming language for browsers. As a framework, we chose the AngularJS, which makes all the manipulation of data in forms and tables much easier. We also have the CSS, in which we use the Bootstrap framework to facilitate the development of web applications interface.

Even with two different technologies, their integration is entirely possible and this will be the main theme discussed throughout the chapters. Note that we will not introduce the two technologies in a separate way, but always addressing how the technologies interact. The communication between them is RESTful, and we will be using it extensively for the development of our final application.

After addressing the main concepts of both technologies, we will create a small blog that will illustrate everything we learned.

About the Authors

Daniel Schmitz
Daniel Schmitz

Daniel Schmitz is a software developer and writer. He's originally from Brazil and has published several books in Portuguese/English.

Table of Contents

  • Part 1- Introduction and installation
    • Chapter 1 - Introduction
      • Windows, Mac or Linux?
      • Source Code
    • Chapter 2 - Preparing the environment in Windows
      • Apache
        • Creating the virtual domain (virtual host)
      • PHP
      • MySql
      • Composer
        • Testing the Composer
      • Laravel
      • Bower
    • Chapter 3 - Preparing the environment in Linux
      • Apache
        • Creating the virtual domain (virtual host)
      • PHP
      • MySql Server
      • Composer
      • Laravel
      • Bower
      • AngularJS + Bootstrap
  • Part 2 - Laravel
    • Chapter 4- Getting to know the Laravel
      • Configuring the virtual host
      • Directory permission
      • Generating an encryption key
      • Routes
      • Routing types (verbs)
      • Passing parameters in routing
      • Using regular expressions
      • Naming routings
      • Grouping routes
      • Middleware
      • Controllers
      • Implicit Controllers (automatic)
      • Controllers and Resource
      • Explicit controllers (manual)
      • Implicit or explicit routing?
      • Ajax
      • JSON Response
      • Exceptions in JSON format
    • Chapter 5 - Database and persistence
      • Configuration
      • Using Laravel to create the tables (Migration)
      • Migration fields creation types
      • Running the migration
      • Create a new record in the table
      • Rollback a migration
      • Additional migration operations
      • Referencing columns from other tables
      • Adding data
      • Tables and additional data
        • Creating the posts data
        • Creating the comments table
        • Creating the table tags
        • Creating the post_tag
      • Recreating the full database structure
      • Query Builder
        • Consulting the SQL generated by the Query Builder
        • Returning all records in the table
        • Stepping through the records after the query
        • Returning the first row of a table
        • Returning a list of values from a table
        • Aggregating values
        • Selecting fields
        • Joins
        • Unions
        • Where
        • Grouping Wheres
        • Order
        • GroupBy e Having
      • Logging Eloquent’s SQLs
      • Eloquent ORM
      • Creating the model
      • Agreements between tables and model
      • Use of the Timestamp
      • Testing the User model
        • Routing
        • Create the method on the controller
        • Understanding the UserController
      • Relationships in Eloquent
        • Relationships between users and posts
        • Relationship between Posts and Comments
        • Relationship between Posts and Tags
        • One-to-one relationship
        • One-to-many relationship through (Has Many Through)
        • Analyzing the existence of records in a relationship
      • Eager Loading vs Lazy Loading and the N+1 problem
      • Eager Loading and more advanced queries
      • Inserting and updating records
      • Removing records
      • Using scopes
      • Events
      • Accessors & Mutators
      • Serializing data in JSON
      • Removing fields from JSON serialization
      • Adding Accessor serialization
      • Adding relationships in Serialization
  • Part 3 - AngularJS and Bootstrap
    • Chapter 6 - Introduction to AngularJS
      • Expressions
      • DataBind
      • Controllers
      • Methods in the controller
      • Loops
      • Forms
      • Routes and Deep linking
    • Chapter 7 - Bootstrap
      • Installing the Bootstrap
      • Grid System
      • Working with offsets
      • Typography
      • Alignment
      • Creating emphasis to text with colors
      • Abbreviation
      • Blockquotes
      • Lists
        • Unstyled
        • Side by side (inline)
        • Lists with horizontal description
      • Tables
      • Simple table
      • Striped rows
      • Borders
      • Highlighting rows
      • Smaller tables (condensed)
      • Contextual lines
      • Merging classes
      • Forms
      • Understand the form-group
      • Inline form
      • Horizontal forms
      • Supported components
      • Checkbox and radio
      • Static controls
      • Disabled fields
      • Validations
      • Field Size
      • Hint text
      • Buttons
      • Size of the buttons
      • Group buttons
      • Icons
      • Dropdown buttons (menu)
      • Differentiated inputs with group
      • AngularJS, Bootstrap and validations
      • Displaying custom error messages
      • Synchronizing errors and submit buttons
      • Extra themes
    • Chapter 8 - AngularJS and Ajax
      • $http usage
      • Handling ajax errors
      • Creating a global loading
      • Disabling the button while sending data
      • $resource usage
  • Part 4 - Laravel and AngularJS
    • Chapter 9 - Connecting Laravel and AngularJS
      • Introduction
      • Workflow
      • Installing AngularJS on Laravel
      • Reconfiguring the routes.php
      • Site header
      • Using DeepLink on the blog
      • Getting posts
      • Inserting the amount of comments
      • Insert the Post author
      • Reviewing the Query Builder
      • Filling the side menu
      • Handle errors
      • Creating a loading global
      • User page
      • Comment screen
      • Tag screen
    • Chapter 10 - Authentication
      • Creating the login form
      • Performing the login
      • Adding features to the site with the user properly logged in
      • Logout of the application
      • Login and logout on Laravel
      • Creating a user from login
    • Chapter 11 - Blog administration screen
      • Creating the admin.html file
      • Configuring admin routing
      • Getting the user login again
      • Protecting the other pages against improper access
      • Creating the CRUD of Tags
      • Implementing the crud via $resource
      • Configuring the tag.html template
      • Formatting the date on the table
      • Setting up Laravel
      • Securing access to the server
      • The CRUD comments
      • CRUD for Posts
      • CRUD for users
      • The user profile view

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub