Provide custom variable to main DatabaseSeeder and give it to my seeders

Posted 7 months ago by Stank0V01

Hello, someone can give me some example how to provide custom variable to my database seeder and then to give it on my custom seeder!

I want smth like this:

<?php

use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run($my_custom_variable_from_model_for_example)
    {
        $this->call(SettingsTableSeeder::class, $my_custom_variable_from_model_for_example);
    }
}

Help.. Thanks!

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.