public function getModelClass()
    {
        $map = config('db-exporter.model.map');

        $namespace = config('db-exporter.model.namespace');
        $class     = snake_case($this->getTable()->getTableName());

        foreach ($map as $item) {
            // Find matching table name
            $tablePattern = '/' . str_replace('/', '\/', $item['tablePattern']) . '/';
            if (preg_match($tablePattern, $this->table->getTableName()) === 1) {

                $namespace = $item['namespace'];

                if ($item['className'] !== null) {
                    $pattern     = '/' . str_replace('/', '\/', $item['className']['pattern']) . '/';
                    $replacement = $item['className']['replacement'];
                    echo $replacement;
                    $class = preg_replace($pattern, $replacement, $class);
                }
                break;
            }
        }

        return $namespace . '\\' . studly_case(str_singular($class));
    }
public function getModelClass()
    {
        $map = config('db-exporter.model.map');

        $namespace = config('db-exporter.model.namespace');
        $class     = snake_case($this->getTable()->getTableName());

        foreach ($map as $item) {
            // Find matching table name
            $tablePattern = '/' . str_replace('/', '\/', $item['tablePattern']) . '/';
            if (preg_match($tablePattern, $this->table->getTableName()) === 1) {

                $namespace = $item['namespace'];

                if ($item['className'] !== null) {
                    $pattern     = '/' . str_replace('/', '\/', $item['className']['pattern']) . '/';
                    $replacement = $item['className']['replacement'];
                    echo $replacement;
                    $class = preg_replace($pattern, $replacement, $class);
                }
                break;
            }
        }

        return $namespace . '\\' . studly_case(str_singular($class));
    }
public function getModelClass ( ) { $ map = config ( 'db-exporter.model.map' ) ; $ namespace = config ( 'db-exporter.model.namespace' ) ; $ class = snake_case ( $ this -> getTable ( ) -> getTableName ( ) ) ; foreach ( $ map as $ item ) { // Find matching table name $ tablePattern = '/' . str_replace ( '/' , '\/' , $ item [ 'tablePattern' ] ) . '/' ; if ( preg_match ( $ tablePattern , $ this -> table -> getTableName ( ) ) === 1 ) { $ namespace = $ item [ 'namespace' ] ; if ( $ item [ 'className' ] !== null ) { $ pattern = '/' . str_replace ( '/' , '\/' , $ item [ 'className' ] [ 'pattern' ] ) . '/' ; $ replacement = $ item [ 'className' ] [ 'replacement' ] ; echo $ replacement ; $ class = preg_replace ( $ pattern , $ replacement , $ class ) ; } break ; } } return $ namespace . '\\' . studly_case ( str_singular ( $ class ) ) ; }
Get class model

@return string
Get class model