src/Console/AdministratorCreateCommand.php
protected function createUserInstance($data)
    {
        $config = app('scaffold.config');

        if (!$model = $this->fetchModel($config)) {
            throw new Exception('Could not find a model to create user.');
        }

        try {
            $model::unguard();

            return (new $model())->create($this->dataWithId($data));
        } catch (Exception $e) {
            return (new $model())->create($data);
        }
    }
protected function createUserInstance($data)
    {
        $config = app('scaffold.config');

        if (!$model = $this->fetchModel($config)) {
            throw new Exception('Could not find a model to create user.');
        }

        try {
            $model::unguard();

            return (new $model())->create($this->dataWithId($data));
        } catch (Exception $e) {
            return (new $model())->create($data);
        }
    }
protected function createUserInstance ( $ data ) { $ config = app ( 'scaffold.config' ) ; if ( ! $ model = $ this -> fetchModel ( $ config ) ) { throw new Exception ( 'Could not find a model to create user.' ) ; } try { $ model :: unguard ( ) ; return ( new $ model ( ) ) -> create ( $ this -> dataWithId ( $ data ) ) ; } catch ( Exception $ e ) { return ( new $ model ( ) ) -> create ( $ data ) ; } }
Insert new user into database.

@param $data

@throws Exception

@return Model
Insert new user into database .