O'Reilly logo

Laravel Application Development Cookbook by Terry Matula

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the Generators package to set up an app

Generators is a popular Laravel package that automates quite a bit of file creation. In addition to controllers and models, it can also generate views, migrations, seeds, and more, all through a command-line interface.

Getting ready

For this recipe, we'll be using the Laravel 4 Generators package maintained by Jeffrey Way that was installed in the Downloading and installing packages recipe. We'll also need a properly configured MySQL database.

How to do it…

Follow these steps for this recipe:

  1. Open the command line in the root of our app and, using the generator, create a scaffold for our cities as follows:
    php artisan generate:scaffold cities --fields="city:string"
    
  2. In the command line, create a scaffold ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required