Calling a Repository method from a Seeder class

Posted 3 years ago by SergioGregorutti

Hi all,

Im trying to call a Repository method from a Seeder class but I get an error:

Non-static method Argemundo\Repositories\GuideRepository::updateGuideCategories() should not be called statically, assuming $this from incompatible context

This is my seeder class:

use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
use Argemundo\Repositories\GuideRepository;

class CommerceCategoriesSeeder extends Seeder {

     * Run the database seeds.
     * @return void
    public function run()

            'commerce_id' => 1,
            'category_id' => 9,
            'category_type' => 'Argemundo\CommercesCategoryLevel1',
            'children' => 2]);



I dont know is this is possible. Can someone help me?

Thanks in advance!

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

Reply to

Use Markdown with GitHub-flavored code blocks.