public function grabRecord($table, $attributes = [])
    {
        if (class_exists($table)) {
            if (! $model = $this->findModel($table, $attributes)) {
                $this->fail("Could not find $table with " . json_encode($attributes));
            }

            return $model;
        }

        if (! $record = $this->findRecord($table, $attributes)) {
            $this->fail("Could not find matching record in table '$table'");
        }

        return $record;
    }
public function grabRecord($table, $attributes = [])
    {
        if (class_exists($table)) {
            if (! $model = $this->findModel($table, $attributes)) {
                $this->fail("Could not find $table with " . json_encode($attributes));
            }

            return $model;
        }

        if (! $record = $this->findRecord($table, $attributes)) {
            $this->fail("Could not find matching record in table '$table'");
        }

        return $record;
    }
public function grabRecord ( $ table , $ attributes = [ ] ) { if ( class_exists ( $ table ) ) { if ( ! $ model = $ this -> findModel ( $ table , $ attributes ) ) { $ this -> fail ( "Could not find $table with " . json_encode ( $ attributes ) ) ; } return $ model ; } if ( ! $ record = $ this -> findRecord ( $ table , $ attributes ) ) { $ this -> fail ( "Could not find matching record in table '$table'" ) ; } return $ record ; }
Retrieves record from database
If you pass the name of a database table as the first argument, this method returns an array.
You can also pass the class name of an Eloquent model, in that case this method returns an Eloquent model.

``` php
<?php
$record = $I->grabRecord('users', array('name' => 'davert')); // returns array
$record = $I->grabRecord('App\User', array('name' => 'davert')); // returns Eloquent model
?>
```

@param string $table
@param array $attributes
@return array|EloquentModel
@part orm
Retrieves record from database If you pass the name of a database table as the first argument this method returns an array . You can also pass the class name of an Eloquent model in that case this method returns an Eloquent model .