PHP code example of ycodetech / valet-windows

1. Go to this page and download the library: Download ycodetech/valet-windows library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ycodetech / valet-windows example snippets

console
$ valet php:add "C:\php\7.4"
PHP 7.4.33 from C:\php\7.4 has been added.
console
$ valet php:add "C:\php\7.4" --xdebug
Installing Xdebug for 7.4.33...
PHP 7.4.33 from C:\php\7.4 has been added.

console
$ valet php:remove 7.4.33
$ valet php:remove 7.4
PHP 7.4.33 from c:\php\7.4 has been removed.
console
$ valet php:remove --path="C:\php\7.4"
PHP 7.4.33 from c:\php\7.4 has been removed.

php:install   Reinstall all PHP services from [valet php:list]
console
$ valet php:install
Reinstalling PHP services...

php:uninstall   Uninstall all PHP services from [valet php:list]
console
$ valet php:uninstall
Uninstalling PHP services...
console
$ valet php:list
Listing PHP services...
┌─────────┬───────────────┬────────────┬──────┬─────────────┬─────────┐
| Version | Version Alias | Path       | Port | xDebug Port | Default |
├─────────┼───────────────┼────────────┼──────┼─────────────┼─────────┤
| 8.1.8   | 8.1           | C:\php\8.1 | 9006 | 9106        | X       |
├─────────┼───────────────┼────────────┼──────┼─────────────┼─────────┤
| 7.4.33  | 7.4           | C:\php\7.4 | 9004 | 9104        |         |
└─────────┴───────────────┴────────────┴──────┴─────────────┴─────────┘

php:which         Determine which PHP version the current working directory is using
           [site] Optionally, specify a site
console
$ valet php:which
The current working directory site1 is using PHP 7.4.33 (isolated)

$ valet php:which site2
The specified site site2 is using PHP 8.1.8 (default)