protected function getMigrationFileName(Filesystem $filesystem): string
    {
        $timestamp = date('Y_m_d_His');

        return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR)
            ->flatMap(function ($path) use ($filesystem) {
                return $filesystem->glob($path.'*_create_permission_tables.php');
            })->push($this->app->databasePath()."/migrations/{$timestamp}_create_permission_tables.php")
            ->first();
    }
protected function getMigrationFileName(Filesystem $filesystem): string
    {
        $timestamp = date('Y_m_d_His');

        return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR)
            ->flatMap(function ($path) use ($filesystem) {
                return $filesystem->glob($path.'*_create_permission_tables.php');
            })->push($this->app->databasePath()."/migrations/{$timestamp}_create_permission_tables.php")
            ->first();
    }
protected function getMigrationFileName ( Filesystem $ filesystem ) : string { $ timestamp = date ( 'Y_m_d_His' ) ; return Collection :: make ( $ this -> app -> databasePath ( ) . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR ) -> flatMap ( function ( $ path ) use ( $ filesystem ) { return $ filesystem -> glob ( $ path . '*_create_permission_tables.php' ) ; } ) -> push ( $ this -> app -> databasePath ( ) . "/migrations/{$timestamp}_create_permission_tables.php" ) -> first ( ) ; }
Returns existing migration file if found, else uses the current timestamp.

@param Filesystem $filesystem
@return string
Returns existing migration file if found else uses the current timestamp .