public function have($model, $attributes = [], $name = 'default')
    {
        try {
            return $this->modelFactory($model, $name)->create($attributes);
        } catch (\Exception $e) {
            $this->fail("Could not create model: \n\n" . get_class($e) . "\n\n" . $e->getMessage());
        }
    }
public function have($model, $attributes = [], $name = 'default')
    {
        try {
            return $this->modelFactory($model, $name)->create($attributes);
        } catch (\Exception $e) {
            $this->fail("Could not create model: \n\n" . get_class($e) . "\n\n" . $e->getMessage());
        }
    }
public function have ( $ model , $ attributes = [ ] , $ name = 'default' ) { try { return $ this -> modelFactory ( $ model , $ name ) -> create ( $ attributes ) ; } catch ( \ Exception $ e ) { $ this -> fail ( "Could not create model: \n\n" . get_class ( $ e ) . "\n\n" . $ e -> getMessage ( ) ) ; } }
Use Lumen's model factory to create a model.
Can only be used with Lumen 5.1 and later.

``` php
<?php
$I->have('App\User');
$I->have('App\User', ['name' => 'John Doe']);
$I->have('App\User', [], 'admin');
?>
```

@see https://lumen.laravel.com/docs/master/testing#model-factories
@param string $model
@param array $attributes
@param string $name
@return mixed
@part orm
Use Lumen s model factory to create a model . Can only be used with Lumen 5 . 1 and later .