#Requires -Version 5.1
<#
.SYNOPSIS
  Run php artisan migrate using PHP 8.2+ (same rules as serve.ps1).
#>
$ErrorActionPreference = "Stop"
$projectRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location $projectRoot

. (Join-Path $projectRoot "scripts\Resolve-LaravelPhp.ps1")
$info = Get-LaravelPhp -ProjectRoot $projectRoot

Write-Host "Using PHP $($info.VersionLine) at $($info.PhpExe)" -ForegroundColor Green
$artisan = Join-Path $projectRoot "artisan"
& $info.PhpExe $artisan @("migrate") + @($args)
