You are previewing Learning Laravel 4 Application Development.
O'Reilly logo
Learning Laravel 4 Application Development

Book Description

Develop real-world web applications in Laravel 4 using its refi ned and expressive syntax

  • Build real-world web applications using the Laravel 4 framework

  • Learn how to configure, optimize and deploy Laravel 4 applications

  • Packed with illustrations along with lots of tips and tricks to help you learn more about one of the most exciting PHP frameworks around

In Detail

Laravel 4 is a clean and classy framework for PHP web development. It attempts to ease the development of web applications by simplifying the common tasks required in the majority of web projects, such as authentication, routing, sessions, and caching.

"Learning Laravel 4 Application Development" uses a step-by-step approach to teach you how to build real-world web applications. You will learn how to create a web application from scratch as well as how to create and use packages to build reusable components to be used in your projects.

This book begins by familiarizing you with MVC concepts as well as the Laravel 4 framework. From there, it moves on to the creation of the frontend and backend of your web application. As you progress through the book, you will learn how you can authenticate users as well as develop RESTful APIs. You will also learn how to configure, optimize, and secure your applications. Lastly, it teaches you how to deploy your applications using different approaches like Git, FTP, and SSH.

Laravel 4 Application Development will teach you everything you need to know to create accessible real-world web applications quickly and efficiently.

Table of Contents

  1. Learning Laravel 4 Application Development
    1. Table of Contents
    2. Learning Laravel 4 Application Development
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Welcome to the World of Laravel
      1. Landing yourself into the MVC world
      2. Why Laravel 4 is awesome! And why it must be your next framework
        1. Composer
      3. Summary
    9. 2. Let's Begin the Journey
      1. Installing Laravel 4 on Windows
        1. Installing Composer
        2. Installing Laravel 4
      2. Installing Laravel 4 on Linux/Ubuntu
      3. Installing Laravel 4 on Mac
        1. Exploring the Laravel 4 structure
        2. Configuring Laravel
        3. Configuring the Laravel environment
          1. Configuring the database
          2. Configuring the application
        4. Artisan – magic of Laravel 4
          1. Generating a boilerplate controller
          2. Managing database with migrations
          3. Filling the database with basic data for testing via database seeds
          4. Running unit tests
          5. Maintenance mode
      4. Summary
    10. 3. Creating a Simple CRUD Application in Hours
      1. Getting familiar with Laravel 4
        1. Controllers versus routes
        2. Creating a simple CRUD application with Laravel 4
          1. Listing the users – read users from database
          2. Creating new users
          3. Editing user information
          4. Deleting user information
          5. Adding pagination to our list users
      2. Summary
    11. 4. Building a Real-life Application with Laravel 4 – The Foldagram
      1. Preparing the schema
        1. Setting up the layout
        2. Setting up the inner pages
        3. Creating the newsletter section
        4. Creating a Foldagram form
      2. Summary
    12. 5. Creating a Cart Package for Our Application
      1. Introducing IoC container
      2. Dependency Injection
        1. Service providers
        2. Packages in Laravel 4
        3. Package structure
        4. Facades
        5. Cart functions
          1. The Cart class
          2. Adding Foldagram to the cart
          3. Updating the cart
          4. Deleting from cart
          5. Viewing the cart contents
          6. Viewing the cart total
          7. Deleting all items from the cart
        6. Integrating the Cart package in Foldagram order process
          1. Adding the Foldagram information to the Foldagram table
        7. Image resizing in Laravel
          1. Adding the recipient information to the Recipients table
          2. Adding the Foldagram order details to our Cart package
          3. Creating the preview page to preview Foldagram
          4. Deleting the recipient's information
          5. Editing the Foldagram information
          6. Deleting Foldagram from the cart
      3. Summary
    13. 6. User Management and Payment Gateway Integration
      1. Introducing the Sentry package
      2. Setting up our user section
        1. Register user
        2. User login
        3. The User dashboard
        4. Change password
      3. Checkout & payment gateway integration
        1. Building the checkout page for credit cards
        2. Integrating Stripe payment gateway
        3. Creating the checkout order process
        4. Building the credits section
        5. Building the view orders section
      4. Summary
    14. 7. The Admin Section
      1. Building the foundation for the administration section
      2. Creating a login section for the administrator
      3. Managing orders
        1. Building the view recipients section
        2. Building the order details section
        3. Updating order status
        4. Deleting orders
      4. Exporting orders
      5. Managing Foldagram pricing
      6. Adding credit for the user
      7. Managing users
        1. Adding users
        2. Editing users
        3. Deleting users
        4. Blocking users
      8. Summary
    15. 8. Building a RESTful API with Laravel – Store Locator
      1. REST basics
      2. A store locator's single page web application
        1. Creating a REST API in Laravel 4 using Resource Controllers
        2. Creating a RESTful backend
        3. Creating an API to view all the stores
        4. Building an API method for viewing an individual store
        5. Creating an API method for searching the stores
        6. Adding a store method to our API
        7. Updating the store method of our API
        8. Creating an API method for deleting a store client
        9. Creating a frontend via a RESTful API
      3. Summary
    16. 9. Optimizing and Securing Our Applications
      1. Handling errors
      2. Profiling Laravel applications
      3. Logging data with Laravel
      4. Security in Laravel
        1. SQL injections
        2. CSRF
        3. XSS (Cross site scripting)
      5. Summary
    17. 10. Deploying Laravel Applications
      1. Creating production configuration
      2. Creating a directory structure based on your web host
      3. Uploading your Laravel application directory files
        1. Deploying via SSH
        2. Uploading files via OpenSSH (Linux, Mac)
        3. Uploading files via Putty (Windows)
      4. Creating a database in the production site and uploading your local database on the production site
      5. Giving proper permissions to your storage files
      6. Setting up .htaccess based on your server
        1. Deploying via FTP
        2. Deploying via SSH from the Git repository
        3. Deploying via FTP from the Git repository
      7. Summary
    18. 11. Creating a Workflow and Useful Laravel Packages and Tools
      1. Creating a workflow
        1. Introducing JeffreyWay/Laravel-4-Generators
      2. Summary
    19. Index