Leanpub Header

Skip to main content

Laravel 5.4 For Beginners

Laravel 5.4 for Beginners stands you up quickly Laravel, Mix and Vue.js.  A step by step approach to building a sample application with one-click Facebook registration, searchable and sortable datagrids, and chat implemented with Laravel Echo, Pusher, and Vue.js.  The book uses the latest version of Vue 2.  You will love the Laravel framework! 

Minimum price

$14.95

$29.95

You pay

$29.95

Author earns

$23.96
$

...Or Buy With Credits!

You can get credits monthly with a Reader Membership
PDF
EPUB
WEB
952
Pages
About

About

About the Book

Laravel 5.4 For Beginners is oriented to beginning and intermediate PHP programmers who want to learn the Laravel Framework.  Over 900 pages of step by step content. In the book, we build a sample application that covers the following:

  • One-click Facebook Registration
  • Full Access Control
  • Datagrid with column sorts, powered by Vue.js
  • Image Management with Intervention Image Package
  • Laravel Mix Asset Management
  • Events
  • Sending Email with Markdown
  • A working Chat application with realtime updates
  • Laravel Echo, Vue.js and Pusher
  • Plus all the basics of application development

The sample app is written with simple, practical code that is explained in granular detail. You've probably heard a lot of great things about Laravel and they are all true.  You will love working with Laravel!

Laravel 5.4 For Beginners is written and maintained by Bill Keck, an author with a passion for writing and PHP frameworks.  His books and blogs are read by programmers all over the world.  He strives to help programmers new to the Laravel framework understand it, with clear and full implementations, so that everyone can take advantage of the amazing Laravel PHP framework.

Share this book

Author

About the Author

Bill Keck

Bill Keck is the author of 100 Patterns For Success, Laravel 5.4 For Beginners and other books on Laravel and PHP Frameworks.  He actively maintains the PHP Frameworks Blog and the Laravel Tips blog.

Contents

Table of Contents

Chapter 1: Introduction

  1. Introduction
  2. Features
  3. What Makes The Laravel Framework Special?
  4. Upsides
  5. Downsides
  6. Why I’m Writing This Book
  7. Artisan
  8. MySql
  9. Documentation
  10. Minimum PHP Skills
  11. W3 Schools
  12. Laracasts
  13. Minimum HTML and CSS skills
  14. Minimum Javascript Skills
  15. Minimum Node.js Experience
  16. Errata
  17. Contact Bill Keck
  18. Sample App on Github
  19. Summary

Chapter 2: The Development Environment

  1. Setting up the Dev Environment
  2. MAC or Windows?
  3. MAMP
  4. IDE
  5. Composer
  6. Minimum Version of PHP
  7. Node.js
  8. Homebrew
  9. Git
  10. Command Console
  11. Summary

Chapter 3: Installation of Laravel

  1. Composer install of Laravel
  2. Create Project in IDE
  3. Setup Local Host file:
  4. Vhost Entry
  5. httpd.conf
  6. MOD Rewrite
  7. Restart Apache
  8. Summary

Chapter 4: Let’s Get Started With Laravel

  1. Set Up The Repository
  2. Initial Commit
  3. Diving Into Workflow
  4. Setup the DB
  5. .env
  6. Application Structure
  7. Basic Stitching
  8. Routes
  9. The Style Problem
  10. Unit Testing
  11. Creating a Route
  12. Creating a Controller
  13. Artisan
  14. RESTful pattern
  15. Namespaces and Use Statements
  16. Index Method
  17. Views
  18. Blade
  19. Creating A Master Page
  20. CDN
  21. View Partials
  22. Full Code
  23. Summary

Chapter 5: User Registration And Login

  1. Controllers
  2. User Model
  3. Migrations
  4. Make Auth
  5. RegisterController
  6. Traits
  7. Gravatar
  8. Facades
  9. Pages Controller
  10. New Nav
  11. Auth Methods
  12. Auth Views
  13. passwords view folder
  14. email.blade.php view
  15. reset.blade.php
  16. Auth View Folder
  17. register.blade.php
  18. login.blade.php
  19. Change redirectTo Properties
  20. Summary

Chapter 6: Working with the RESTful Pattern

  1. Sweet Alert
  2. Usage
  3. Flash Messages
  4. Model
  5. Model Factory
  6. Route Resource
  7. RESTful Controller
  8. Errors List
  9. Errors Folder
  10. Store Method
  11. Die and Dump
  12. Index Method
  13. Pagination
  14. Create Button
  15. Slugs
  16. Changing the Store Method
  17. Create the Slug
  18. Changing the Create Method
  19. Add Auth Use Statement
  20. Change $fillable Property on Widget Model
  21. Basic Relationships
  22. Add Middleware to WidgetController
  23. Change Routes to Widget
  24. Modify index view
  25. New Factory method
  26. Show Method
  27. Accessors and Mutators
  28. Edit Method
  29. Update Method
  30. Destroy Method
  31. Automatic Route Model Binding
  32. Error Handling
  33. 404.blade.php
  34. Exceptions
  35. Summary

Chapter 7: Access Control

  1. OwnsRecord Trait
  2. Modify User Table Migration
  3. User $fillable
  4. Admin Middleware
  5. AllowIfAdmin
  6. isAdmin Method
  7. Admin Index
  8. NoActiveAccountException
  9. Modifying the LoginController
  10. LoginController
  11. Update Users Table
  12. Registration Form
  13. register.blade.php
  14. Users Migration
  15. Update User $fillable
  16. RegisterController
  17. Create Method
  18. Terms Of Service
  19. Privacy
  20. Summary

Chapter 8: Socialite - One Click Facebook Login

  1. Facebook
  2. Social Routes
  3. session.php
  4. Clear Cookies
  5. InvalidStateException
  6. Tip for nginx users.
  7. Set up Facebook App
  8. Step 1
  9. Step 2
  10. Step 3
  11. Step 4
  12. Step 5
  13. Step 6
  14. Step 7
  15. Step 8
  16. Step 9
  17. Step 10
  18. Step 11
  19. Integrating Socialite
  20. Exceptions
  21. A Big Heads Up
  22. AuthController
  23. Tip For Staying Current
  24. ManagesSocial.php
  25. Putting It All Together
  26. Database Transactions
  27. Summary

Chapter 9: Profile, Settings and Admin Dash

  1. Profile
  2. determine-profile-route and show-profile Routes
  3. Add Profile to Nav
  4. Profile Views
  5. Show View - Profile
  6. Index View - Profile
  7. Edit View - Profile
  8. Users For Admin
  9. UserController.php
  10. UserRequest
  11. User Model changes
  12. HasModelTrait
  13. Index View
  14. Show View
  15. Edit View
  16. Navigation to Users & Profiles
  17. Settings
  18. Settings Routes
  19. SettingsController
  20. Create Settings View Folder
  21. Edit View For Settings
  22. Add Settings To Nav
  23. Admin Page
  24. Add Facebook sign in buttons to Login and Register Views
  25. View Composers
  26. View Share
  27. Summary

Chapter 10: Working With Images

  1. Create imgs, marketing-images, and thumbnails folder.
  2. Create Image Request
  3. Show Method
  4. Add Display Methods to MarketingImage Model
  5. ShowsImages trait.
  6. show view
  7. Edit view
  8. Edit Method
  9. Edit Image Request
  10. Update method
  11. Destroy Method
  12. Index method
  13. index view
  14. Add Marketing Images To Nav
  15. Carousel
  16. Pages Index View
  17. Update slider.blade.php
  18. image_weight
  19. Modify MarketingImageController
  20. CreateImageRequest and EditImageRequest
  21. Marketing Image Create and edit Views
  22. MarketingImage Show View
  23. PagesController Index Method
  24. grid.blade.php
  25. MarketingImageController Index Method
  26. marketing-image index.blade.php
  27. Summary

Chapter 11 Introducing Mix and Vue.js

  1. Node
  2. NPM
  3. Running NPM Install
  4. Compiling Multiple Assets
  5. Versioning
  6. Vue.js
  7. Vue Basics
  8. Summary

Chapter 12: Data Grids with Vue.js

  1. Datagrid
  2. Api Route
  3. ApiController
  4. Implementing A Contract
  5. main.scss
  6. WidgetGrid.vue
  7. MarketingImage Data Grid
  8. API route
  9. marketingImageData method on Api Controller
  10. MarketingImageQuery.php
  11. MarketingImageGrid.vue
  12. npm run dev
  13. MarketingImageController.php
  14. marketing-image/index.blade.php
  15. Summary

Chapter 13: Events, Mail, and Architecture.

  1. Mail
  2. Email Confirmation On Registration
  3. config/mail.php
  4. Passing Data to the Email
  5. Markdown Email
  6. Custom Themes
  7. Events
  8. Registering the Event
  9. Naming Events
  10. event:generate
  11. ShouldQueue
  12. Application Structure
  13. The Service Container
  14. Automatic Injection
  15. Method Injection
  16. Constructor Injection
  17. Service Providers
  18. Aliases
  19. Facades In Realtime
  20. Summary

Chapter 14 Chat with Laravel Echo, Vue, and Pusher

  1. Vue.js Nested Components
  2. Chat
  3. Routes
  4. Chat Controller
  5. Message Migration
  6. Message Model
  7. Eager Loading
  8. Query Scopes
  9. Messages Method On User Model
  10. Messages Factory
  11. Chat Front End
  12. Chat Index
  13. components.js
  14. app.js
  15. ChatList.vue
  16. ChatMessage.vue
  17. Installing Moment.js
  18. ChatCreate.vue
  19. Pusher
  20. Laravel Echo
  21. Console Command
  22. Summary

Chapter 15: Custom Validators and Vue. js Dependent Dropdown

  1. Setting Up The Lesson
  2. Category Model
  3. Category Migration
  4. Category Controller
  5. Category Views
  6. category/create.blade.php
  7. category/edit.blade.php
  8. category/index.blade.php
  9. category/show.blade.php
  10. CategoryGrid
  11. components.js
  12. Add categoryData method to ApiController.php
  13. CategoryQuery.php
  14. Category Factory
  15. Subcategory
  16. Subcategory Model
  17. Subcategory Migration
  18. Subcategory Controller
  19. Subcategory Views
  20. subcategory/create.blade.php
  21. subcategory/edit.blade.php
  22. subcategory/index.blade.php
  23. subcategory/show.blade.php
  24. SubcategoryGrid.vue
  25. components.js
  26. ApiController
  27. SubcategoryQuery.php
  28. Seed data
  29. Route
  30. Lesson Model
  31. Lesson.php
  32. Lesson Migration
  33. LessonController
  34. LessonController.php
  35. Lesson Views
  36. lesson/create
  37. lesson/edit.blade.php
  38. lesson/index.blade.php
  39. lesson/show.blade.php
  40. LessonGrid.vue
  41. components.js
  42. ApiController
  43. Api Route for Lesson Model
  44. LessonQuery
  45. Custom Validation
  46. Lesson Create Request
  47. Validator Service Provider
  48. Multiple Custom Validation Rules
  49. Left Join
  50. LessonQuery.php Revised
  51. LessonGrid.vue Revised
  52. Lesson Show Revised
  53. Dependent Dropdown
  54. LessonCreateCategory.vue
  55. lesson/edit.blade.php
  56. LessonEditCategory.vue
  57. Summary

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