how to test laravel phpunit but not with your database code example
Example: test laravel create each(function ($u)
public function run()
{
factory(App\User::class, 2)->create()->each(function($u) {
$u->issues()->save(factory(App\Issues::class)->make());
});
}