src/Commands/MigrationCommand.php
protected function createMigration($data)
    {
        $migrationFile = base_path('/database/migrations') . '/' . date('Y_m_d_His') . '_shop_setup_tables.php';

        $usersTable  = Config::get('auth.table');
        $userModel   = Config::get('auth.model');
        $userKeyName = (new $userModel())->getKeyName();

        $data = array_merge($data, compact('usersTable', 'userKeyName'));

        $output = $this->laravel->view->make('laravel-shop::generators.migration')->with($data)->render();

        if (!file_exists($migrationFile) && $fs = fopen($migrationFile, 'x')) {
            fwrite($fs, $output);
            fclose($fs);
            return true;
        }

        return false;
    }
protected function createMigration($data)
    {
        $migrationFile = base_path('/database/migrations') . '/' . date('Y_m_d_His') . '_shop_setup_tables.php';

        $usersTable  = Config::get('auth.table');
        $userModel   = Config::get('auth.model');
        $userKeyName = (new $userModel())->getKeyName();

        $data = array_merge($data, compact('usersTable', 'userKeyName'));

        $output = $this->laravel->view->make('laravel-shop::generators.migration')->with($data)->render();

        if (!file_exists($migrationFile) && $fs = fopen($migrationFile, 'x')) {
            fwrite($fs, $output);
            fclose($fs);
            return true;
        }

        return false;
    }
protected function createMigration ( $ data ) { $ migrationFile = base_path ( '/database/migrations' ) . '/' . date ( 'Y_m_d_His' ) . '_shop_setup_tables.php' ; $ usersTable = Config :: get ( 'auth.table' ) ; $ userModel = Config :: get ( 'auth.model' ) ; $ userKeyName = ( new $ userModel ( ) ) -> getKeyName ( ) ; $ data = array_merge ( $ data , compact ( 'usersTable' , 'userKeyName' ) ) ; $ output = $ this -> laravel -> view -> make ( 'laravel-shop::generators.migration' ) -> with ( $ data ) -> render ( ) ; if ( ! file_exists ( $ migrationFile ) && $ fs = fopen ( $ migrationFile , 'x' ) ) { fwrite ( $ fs , $ output ) ; fclose ( $ fs ) ; return true ; } return false ; }
Create the migration.

@param array $data Data with table names.

@return bool
Create the migration .