Leanpub Header

Skip to main content

Laravel and AngularJS

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

The book Laravel and AngularJS presents the best server technology with the most used Javascript library. Enjoy and discover what is best in other technologies covered in this e-book, such as Bower, Bootstrap, and Composer.

Minimum price

$29.90

$29.90

You pay

$29.90

Authors earn

$23.92
$

...Or Buy With Credits!

You can get credits monthly with a Reader Membership
PDF
EPUB
WEB
217
Readers
345
Pages
26,223Words
About

About

About the Book

Versions:

  • 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.

Share this book

Author

About the Authors

Daniel Schmitz

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

Daniel Pedrinha Georgii

Translations

Translations

Contents

Table of Contents

Part 1- Introduction and installation

Chapter 1 - Introduction

  1. Windows, Mac or Linux?
  2. Source Code

Chapter 2 - Preparing the environment in Windows

  1. Apache
  2. Creating the virtual domain (virtual host)
  3. PHP
  4. MySql
  5. Composer
  6. Testing the Composer
  7. Laravel
  8. Bower

Chapter 3 - Preparing the environment in Linux

  1. Apache
  2. Creating the virtual domain (virtual host)
  3. PHP
  4. MySql Server
  5. Composer
  6. Laravel
  7. Bower
  8. AngularJS + Bootstrap
  9. Part 2 - Laravel

Chapter 4- Getting to know the Laravel

  1. Configuring the virtual host
  2. For Linux environments
  3. Directory permission
  4. Generating an encryption key
  5. Routes
  6. Routing types (verbs)
  7. Passing parameters in routing
  8. Using regular expressions
  9. Naming routings
  10. Grouping routes
  11. Middleware
  12. Controllers
  13. Implicit Controllers (automatic)
  14. Controllers and Resource
  15. Explicit controllers (manual)
  16. Implicit or explicit routing?
  17. Ajax
  18. JSON Response
  19. Exceptions in JSON format

Chapter 5 - Database and persistence

  1. Configuration
  2. Using Laravel to create the tables (Migration)
  3. Migration fields creation types
  4. Running the migration
  5. Create a new record in the table
  6. Rollback a migration
  7. Additional migration operations
  8. Referencing columns from other tables
  9. Adding data
  10. Tables and additional data
  11. Creating the posts data
  12. Creating the comments table
  13. Creating the table tags
  14. Creating the post_tag
  15. Recreating the full database structure
  16. Query Builder
  17. Consulting the SQL generated by the Query Builder
  18. Returning all records in the table
  19. Stepping through the records after the query
  20. Returning the first row of a table
  21. Returning a list of values from a table
  22. Aggregating values
  23. Selecting fields
  24. Joins
  25. Unions
  26. Where
  27. Grouping Wheres
  28. Order
  29. GroupBy e Having
  30. Logging Eloquent’s SQLs
  31. Eloquent ORM
  32. Creating the model
  33. Agreements between tables and model
  34. Use of the Timestamp
  35. Testing the User model
  36. Routing
  37. Create the method on the controller
  38. Understanding the UserController
  39. Relationships in Eloquent
  40. Relationships between users and posts
  41. Relationship between Posts and Comments
  42. Relationship between Posts and Tags
  43. One-to-one relationship
  44. One-to-many relationship through (Has Many Through)
  45. Analyzing the existence of records in a relationship
  46. Eager Loading vs Lazy Loading and the N+1 problem
  47. Eager Loading and more advanced queries
  48. Attention
  49. Inserting and updating records
  50. Removing records
  51. Using scopes
  52. Events
  53. Accessors & Mutators
  54. Serializing data in JSON
  55. Removing fields from JSON serialization
  56. Adding Accessor serialization
  57. Adding relationships in Serialization
  58. Part 3 - AngularJS and Bootstrap

Chapter 6 - Introduction to AngularJS

  1. Remember!
  2. Expressions
  3. DataBind
  4. Controllers
  5. Understand this example!
  6. Methods in the controller
  7. Loops
  8. Forms
  9. Routes and Deep linking
  10. Attention
  11. Attention

Chapter 7 - Bootstrap

  1. Installing the Bootstrap
  2. Grid System
  3. Working with offsets
  4. Typography
  5. Alignment
  6. Creating emphasis to text with colors
  7. Abbreviation
  8. Blockquotes
  9. Lists
  10. Unstyled
  11. Side by side (inline)
  12. Lists with horizontal description
  13. Tables
  14. Simple table
  15. Striped rows
  16. Borders
  17. Highlighting rows
  18. Smaller tables (condensed)
  19. Contextual lines
  20. Merging classes
  21. Forms
  22. Understand the form-group
  23. Inline form
  24. Horizontal forms
  25. Supported components
  26. Checkbox and radio
  27. Static controls
  28. Disabled fields
  29. Validations
  30. Field Size
  31. Hint text
  32. Buttons
  33. Size of the buttons
  34. Group buttons
  35. Icons
  36. Dropdown buttons (menu)
  37. Differentiated inputs with group
  38. AngularJS, Bootstrap and validations
  39. Displaying custom error messages
  40. Synchronizing errors and submit buttons
  41. Extra themes

Chapter 8 - AngularJS and Ajax

  1. $http usage
  2. Handling ajax errors
  3. Creating a global loading
  4. Disabling the button while sending data
  5. $resource usage
  6. Part 4 - Laravel and AngularJS

Chapter 9 - Connecting Laravel and AngularJS

  1. Introduction
  2. Workflow
  3. Installing AngularJS on Laravel
  4. Reconfiguring the routes.php
  5. Site header
  6. Using DeepLink on the blog
  7. Getting posts
  8. Inserting the amount of comments
  9. Insert the Post author
  10. Reviewing the Query Builder
  11. Filling the side menu
  12. Handle errors
  13. Attention!
  14. Creating a loading global
  15. User page
  16. Comment screen
  17. Tag screen

Chapter 10 - Authentication

  1. Creating the login form
  2. Performing the login
  3. Adding features to the site with the user properly logged in
  4. Logout of the application
  5. Login and logout on Laravel
  6. Creating a user from login

Chapter 11 - Blog administration screen

  1. Creating the admin.html file
  2. Configuring admin routing
  3. Getting the user login again
  4. Protecting the other pages against improper access
  5. Creating the CRUD of Tags
  6. Implementing the crud via $resource
  7. Configuring the tag.html template
  8. Formatting the date on the table
  9. Setting up Laravel
  10. Securing access to the server
  11. The CRUD comments
  12. CRUD for Posts
  13. CRUD for users
  14. The user profile view

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

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...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

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

In fact, authors have earned over $14 million writing, 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