Evercode1\ViewMaker\RemovesFiles::getMigrationFilePath PHP Method

getMigrationFilePath() private method

private getMigrationFilePath ( $model )
    private function getMigrationFilePath($model)
    {
        $migrationModelName = str_plural(snake_case($model));
        $file = 'create_' . $migrationModelName . '_table';
        $migrations = scandir(base_path('database/migrations'));
        foreach ($migrations as $migration) {
            if (str_contains($migration, $file)) {
                $file = $migration;
            }
        }
        return base_path('database/migrations/') . $file;
    }