Book Image

Laravel Application Development Blueprints

By : Arda Kılıçdağı, Halil İbrahim Yılmaz
Book Image

Laravel Application Development Blueprints

By: Arda Kılıçdağı, Halil İbrahim Yılmaz

Overview of this book

<p>Laravel is a clean and classy framework for PHP web development. It helps you to create wonderful applications using simple, expressive syntax. Development should be a creative and enjoyable experience, not something that is painful, and Laravel makes it enjoyable for the users. Laravel's directory structure is designed to be familiar to users of other popular PHP frameworks. Web applications of any shape or size can easily be created using this structure similar to the way that they would be created in other frameworks. With the recently released 4th Version, Laravel became even better in numerous ways. Within this book, we will help you learn about both the old and new features of Laravel while developing various applications.</p> <p>Laravel Application Development Blueprints covers how to develop 10 different applications step-by-step using Laravel 4. You will also learn about both basic and advanced usage of Laravel’s built-in methods, which will come in handy for your project. Also, you will learn how to extend the current libraries with the built-in methods and include third-party libraries.</p> <p>This book looks at the Laravel PHP framework and breaks down the ingrained prejudice that coding with PHP causes due to spaghetti code. It will take you through a number of clear, practical applications that will help you to take advantage of the Laravel PHP framework and PHP OOP programming whilst avoiding spaghetti code.</p> <p>You'll also learn about creating secure web applications using different methods such as file uploading and processing, making RESTful AJAX requests, and form processing. If you want to take advantage of the Laravel PHP framework's validate, file processing, and RESTful controllers in various types of projects, then this is the book for you.<br />Everything you need to know to code fast and secure applications with the Laravel PHP framework will be discussed in this book.</p>
Table of Contents (17 chapters)
Laravel Application Development Blueprints
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Creating and migrating the actors database


We need to create an actors table that will contain the names of the actors of the movies. We need a migration file to create our movies table and columns. We'll do it again with the artisan tool. Let's open up our terminal, navigate to our project folder, and run the following command:

php artisan migrate:make create_actors_table --table=actors –create

Open the migration file that was created recently and located at app/database/migrations/. We need to edit the up() function as follows:

  public function up()
  {
    Schema::create('actors', function(Blueprint $table)
    {
      $table->increments('id');
      $table->string('name');
      $table->timestamps();
    });
  }

After editing the migration file, run the migrate command as follows:

php artisian migrate