PHP 8.3.31
Preview: TableGuesser.php Size: 907 B
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/TableGuesser.php

<?php

namespace Illuminate\Database\Console\Migrations;

class TableGuesser
{
    const CREATE_PATTERNS = [
        '/^create_(\w+)_table$/',
        '/^create_(\w+)$/',
    ];

    const CHANGE_PATTERNS = [
        '/.+_(to|from|in)_(\w+)_table$/',
        '/.+_(to|from|in)_(\w+)$/',
    ];

    /**
     * Attempt to guess the table name and "creation" status of the given migration.
     *
     * @param  string  $migration
     * @return array
     */
    public static function guess($migration)
    {
        foreach (self::CREATE_PATTERNS as $pattern) {
            if (preg_match($pattern, $migration, $matches)) {
                return [$matches[1], $create = true];
            }
        }

        foreach (self::CHANGE_PATTERNS as $pattern) {
            if (preg_match($pattern, $migration, $matches)) {
                return [$matches[2], $create = false];
            }
        }
    }
}

Directory Contents

Dirs: 0 × Files: 10

Name Size Perms Modified Actions
1.46 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
4.55 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
1.64 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
11.10 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
4.46 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
4.98 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.71 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
2.72 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
4.30 KB lrw-rw-rw- 2025-09-17 06:53:01
Edit Download
907 B lrw-rw-rw- 2025-09-17 06:53:01
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).