Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

swist's avatar
Level 11

php artisan make:seed makes template file instead of real seed file

Hi,

The command:

php artisan make:seed RoleTableSeeder

Makes template file instead of compiling it into real seed file. So output file looks like this:

<?php

use Illuminate\Database\Seeder;

// composer require laracasts/testdummy
use Laracasts\TestDummy\Factory as TestDummy;

class {{class}} extends Seeder
{
    public function run()
    {
        // TestDummy::times(20)->create('App\Post');
    }
}

And the file is called RoleTableSeederTableSeeder (double TableSeeder). How can I fix it to work properly. I use laravel 5.2 upgraded from 5.1

0 likes
7 replies
bobbybouwmann's avatar

I guess you broke something... This works fine for me!

Did you add the correct dependenties with composer as mentioned in the upgrade guide?

swist's avatar
Level 11

@bobbybouwmann

Yes I know, in my other projects the command works fine. Maybe it happends when I upgraded Laravel from 5.1 to 5.2. But I don't know where to looks.

@dmitov

I get an error:

[Symfony\Component\Console\Exception\RuntimeException]
  The "--class" option does not exist.
swist's avatar
Level 11

And yes, I've added all dependencies from guide.

dmitov's avatar

Hello @swist,

Sorry about my previous comment, I was mistaken. Can you post your composer.json file?

swist's avatar
Level 11
{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "fzaninotto/faker": "^1.5",
        "intervention/image": "^2.3"
    },
    "require-dev": {
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1",
        "laracasts/generators": "^1.1",
        "symfony/dom-crawler": "~3.0",
        "symfony/css-selector": "~3.0"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan optimize"
        ],
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}
dhonions's avatar

Did you find a solution to the missing option?

swist's avatar
Level 11

No, I write new seeds by hand (not using php artisan).

Please or to participate in this conversation.