Call database seeder from a subfolder

laravel-4, php

Solution

You shouldn't need to edit your `classmap` on your project, just make sure to run

composer dump-autoload

after moving your class to a subfolder.

Once you've done that, run this (no need to mention testData here)

php artisan db:seed --class="myTestSeeder"

Problem

I want to create a set of database seed classes specifically for adding data for test cases I'm writing. My plan was to put them in the folder: ``` app/database/seeds/testData/ ``` and then call the seeder via the command: ``` php artisan db:seed --class="testData/myTestSeeder" ``` But I get a "class does not exist" error. Is it possible to call database seeders that live in a subfolder in seeds? I don't see an explicit "yes" in the docs, but I don't see an explicit "no" either.

Original source