Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More then one row beeing adding to relational models #109

Open
dimpu opened this issue Sep 1, 2015 · 0 comments
Open

More then one row beeing adding to relational models #109

dimpu opened this issue Sep 1, 2015 · 0 comments

Comments

@dimpu
Copy link

dimpu commented Sep 1, 2015

I trying to follow the tutorial at https://laracasts.com/lessons/whats-new-in-testdummy by @JeffreyWay

When i have code as

$factory('App\User',[
    'name' => $faker->name,
    'email' => $faker->email,
    'password'=> bcrypt('Passw0rd')
]);
$factory('App\Post',[
    'title' => $faker->name,
        'user_id' => 'factory:App\User'
]);

and my DatabaseSeeder.php

<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        Model::unguard();
        $this->call(PostTableSeeder::class);
        Model::reguard();
    }
}

Now the issue is in database i can see there are many users created in database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant