Windows version of Laravel Valet

Overview

Laravel Valet For Windows Latest Stable Version License Analytics

Laravel Valet for Windows

Introduction

This is Windows version of Laravel Valet. Valet is a Laravel development environment for minimalists. This Windows version brings even less software than Valet for Mac and you still can share your sites publicly using local tunnels.

Laravel Valet for Windows configures your PC to run Caddy on demand. Then, using c:\Windows\System32\drivers\etc\hosts file, Valet proxies all requests on the *.dev domain to point to sites installed on your local machine.

In other words, a blazing fast Laravel development environment that uses roughly les than 1mb of RAM (see RAM usage). Valet isn't a complete replacement for Vagrant or Homestead, but provides a great alternative if you want flexible basics, prefer extreme speed, or are working on a machine with a limited amount of RAM.

Please, keep in mind, an arbitrary php application won't work in Valet, you need to support them via special drivers. Obviously Laravel is supported, as well, as many others popular php headliners, like Symfony, WordPress, Joomla, etc. See the full list here

Important Notes

  • Set C:\Windows\System32\drivers\etc\hosts file permissions to allow full control for current user/administrator
  • Windows 64-bit is supported (if anyone still needs 32-bit, please, make an issue)
  • Run git-bash as Administrator, as only Administrator can handle symlinks on Windows
  • Sometimes caddy server just stops working (502 Bad Gateway), without any reason, sometimes it stops when the Internet connection is lost, manually running valet restart always helps

Quick How To

This will set up and run a new Laravel application named blog, accessible on localhost http://blog.dev/. Only php and composer are required to run Valet for Windows. See advanced how to if you don't have them yet.

You must use git-bash or similar shell. This doesn't work in standard Windows cmd, native bash will soon come to Windows, fingers crossed.

composer global require laravel/installer vitr/valet4windows
mkdir ~/Sites && cd ~/Sites
laravel new blog
valet install
valet park
valet scan 
valet start
cd blog && valet open 

Advanced How To

Install php & composer

As we run php with Caddy in FastCGI mode download NTS (Non Thread Safe) version (x86 or x64) from http://windows.php.net/download#php-7.0. Extract downloaded archive to C:\php. Copy php.ini-development as php.ini and open it in a text editor. Uncomment extension path for Windows

 ; Directory in which the loadable extensions (modules) reside.
 ; http://php.net/extension-dir
 ; extension_dir = "./"
 ; On windows:
  extension_dir = "ext"

uncomment required extensions, e.g.

; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+)
; extension folders as well as the separate PECL DLL download (PHP 5+).
; Be sure to appropriately set the extension_dir directive.
;
;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_fileinfo.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_exif.dll      ; Must be after mbstring as it depends on it
;extension=php_mysqli.dll
;extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll

Keep in mind Laravel's server requirement https://laravel.com/docs/master/installation#server-requirements.

Tokenizer PHP Extension is included by default in all Windows builds
Add php path (e.g. C:\php) to your system path.

Install composer from https://getcomposer.org/download/. Composer-Setup.exe windows installer does all the work for you, including putting the composer bin folder in your system path, so, later you can easily use commands like laravel or valet.

Install Composer packages

From this point use git-bash or or other bash compatible terminal, as windows cmd doesn't work for us here. It's too much work to completely rewrite all the valet commands in windows shell and hopefully bash support will be included officially in Windows 10 very soon.

composer global require laravel/installer vitr/valet4windows

Updating your hosts file

valet scan

it updates your hosts file C:\Windows\System32\drivers\etc\hosts, so, you have to change its properties to allow full control for current user.

Running Valet

If you're on Windows there is a chance that your ports 80 and 443 are already occupied by ISS or Skype. Read more how to disable ISS here http://stackoverflow.com/questions/30901434/iis-manager-in-windows-10 and how to fix Skype here http://stackoverflow.com/questions/22994888/why-skype-using-http-or-https-ports-80-and-443

Open Laravel site

cd blog && valet open (will open http://blog.dev in chrome)

List of supported applications and frameworks

Unresolved Issues

Testing

I see the benefits of only integration testing here. I would test each valet command and check the outcomes. Unfortunately, travis doesn't support Windows, so, I perform them manually on Windows machine. Later on, I may try https://ci.appveyor.com/

Roadmap

  • compile caddy with this Minimal windows service stub https://github.com/kardianos/minwinsvc
  • update valet drivers
  • demo how to install SSL certificates (so much fun:)
  • Implement the same tests as for Mac and maybe some more
  • Clean up all the OS X leftovers
  • update caddyserver (Latest release v0.9.0)
  • Combine scan with park, forget, link, unlink
  • Move caddy exec to bin, Caddyfile config to ~/.valet
  • fix larawhale names in readme
  • move the history into a standalone history file (see CHANGELOG.md)
  • Port all original mac Valet commands
    • domain
    • fetch-share-url
    • forget
    • help
    • install
    • link (requires run git-bash as administrator)
    • links
    • list
    • logs
    • on-latest-version
    • open
    • park
    • paths
    • restart
    • secure, to get rid of in-browser warning you have to manually install certificate (double click on ~.valet\Certificates\blog.dev.crt and install it in the root)
    • share
    • start
    • stop
    • uninstall
    • unlink
    • unsecure
    • which
Comments
  • valet start cannot find .bat

    valet start cannot find .bat

    when doing valet start i get a prompt : Windows cannot find .bat. Make sure you typed the name correctly, and then try again

    Win 10 both on cmd and cygwin. Valet scan worked fine though as did the install command

    bug 
    opened by mbouclas 24
  • Windows cannot find .bat file on valet start

    Windows cannot find .bat file on valet start

    Hi Vitaliy, Unfortunately, after installing valet it tells me that it cannot find the start.bat file. The error reads:

    Windows cannot find .bat. Make sure you've typed the name correctly, then..
    

    I've gone through the process a few times, but no luck so far.

    Running windows 10 w/ git bash as administrator

    error

    Thanks a lot for your time

    bug help wanted 
    opened by mauroavello 23
  • How to register valet command in global variable

    How to register valet command in global variable

    Hi, I have installed valet4windows and everything worked fine. I created a laravel project in my desktop, then I run the valet install command. But it's not recognized as bash command. How can I register it in global variable, I mean where valet is installed ?

    thank's :)

    opened by Hujjat 12
  • Run valet automatically as background service on Windows startup

    Run valet automatically as background service on Windows startup

    I am not sure if it's intended behavior but I need to manually launch start.bat file to run Valet. Of course , you can add it to shell:startup like any other Windows service to run on system boot but it will still open cmd popup. Is there a way to make this behavior more subtle, similarly to Mac version?

    wontfix 
    opened by adiachenko 3
  • Valet Fatal error

    Valet Fatal error

    When I try to run the valet command I got this error:

    Fatal error: Cannot declare class Brew, because the name is already in use in C:\Users\rafix\AppData\Roaming\Composer\vendor\vitr\valet4windows\cli\includes\facades.php on line 28

    bug 
    opened by rafix 2
  • No such file or directory error

    No such file or directory error

    When I try any valet command I get:

    `$ valet scan PHP Warning: file_get_contents(C:\Users\myself/.valet/config.json): failed to open stream: No such file or directory in C:\Users\myself\AppData\Roaming\Composer\vendor\vitr\valet4windows\cli\Valet\Filesystem.php on line 112

    Warning: file_get_contents(C:\Users\myself/.valet/config.json): failed to open stream: No such file or directory in C:\Users\myself\AppData\Roaming\Composer\vendor\vitr\valet4windows\cli\Valet\Filesystem.php on line 112 PHP Warning: Invalid argument supplied for foreach() in C:\Users\myself\AppData\Roaming\Composer\vendor\vitr\valet4windows\cli\Valet\Host.php on line 42

    Warning: Invalid argument supplied for foreach() in C:\Users\myself\AppData\Roaming\Composer\vendor\vitr\valet4windows\cli\Valet\Host.php on line 42 `

    Any ideas on how to fix this?

    David

    opened by c0h1b4 1
  • start.bat error when profile directory has spaces

    start.bat error when profile directory has spaces

    C:\Users\Josue Haros\AppData\Roaming\Composer\vendor\vitr\valet4windows>2016/12/ 13 16:01:27 args:2 - Parse error: Unknown directive 'Haros.valet\Caddyfile'

    i fixed it by enclosing this line in start.bat start /b bin/caddy --conf=%HOMEDRIVE%%HOMEPATH%.valet\Caddyfile with " start /b bin/caddy --conf="%HOMEDRIVE%%HOMEPATH%.valet\Caddyfile"

    bug 
    opened by josueharos 1
  • valet share command needs support for ngrok -subdomain and -region params

    valet share command needs support for ngrok -subdomain and -region params

    In Unix, you can type valet share [-subdomain=project] [-region=us] to define a custom url (project.ngrok.io or project.us.ngrok.io) but this package has valet share with no params.

    Code https://github.com/vitr/valet4windows/blob/a0126b94be10e302f6c2cb5965c70f40a53329df/cli/valet.php#L58

    opened by leonardoamx 1
  • Fatal error: Cannot redeclare tap()

    Fatal error: Cannot redeclare tap()

    I encountered an issue where I would get this error when using jigsaw by tightenco.

    I fixed my issue by wrapping your function tap() in a if (! function_exists('tap')) statement.

    I'm not sure what other functions would benefit from this.

    illuminate/support (which jigsaw uses) has done this with every function. See helpers.php

    enhancement 
    opened by vmitchell85 1
  • Valet Share does not copy or show the latest ngrok url, but only the first one

    Valet Share does not copy or show the latest ngrok url, but only the first one

    If you use it more than once, it'll open up multiple ngrok instances (which is fine), but it will keep displaying and copying to the clipboard only the first one.

    enhancement 
    opened by lancepioch 2
Releases(v0.9.7)
Owner
Vitr's Archived Projects
I wouldn't say abandoned, but not actively supported.
Vitr's Archived Projects
Quick new application creation with Laravel and Valet

Super-powered laravel new for Laravel and Valet Lambo is a command-line tool that replaces the Laravel installer and wraps up the most common tasks yo

Tighten 593 Dec 30, 2022
A web based UI for browsing the projects being served by Laravel Valet.

?? Valet Launchpad A web based UI for browsing the projects being served by Laravel Valet. Built on Laravel (with TailwindCSS & Alpine.JS), this small

George Buckingham 20 Dec 14, 2022
A Laravel Admin Panel (Laravel Version : 6.0)

Laravel Admin Panel (Current: Laravel 7.*) Introduction Laravel Admin Panel provides you with a massive head start on any size web application. It com

ftxinfotech 903 Dec 31, 2022
Example of create, update, delete and read operations in laravel 9 version.

Laravel 9 CRUD Example Example of create, update, delete and read operations in laravel 9 version. Download Step 1 (download the project.) git clone h

Ali Yılmaz 4 Aug 3, 2022
lara setups is a new star kit for installing latest and greetest version of vue js and bootstrap

Lara setups Introduction lara setups helps you to install latest bootstrap and vue.js version on your laravel project laravel team no longer supports

Mohammad khazaee 11 Jul 12, 2022
A Laravel Starter Kit for Laravel. Built with Laravel 8.

Laravel Get Started Project Laravel Get Started Project is a basic crud app built with laravel 8. In this app a basic product crud created. Features i

Nazmul Hasan Robin 8 Nov 24, 2022
LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like Advanced CRUD Generation, Module Manager, Backups and many more.

LaraAdmin 1.0 LaraAdmin is a Open source CRM for quick-start Admin based applications with features like Advanced CRUD Generation, Schema Manager and

Dwij IT Solutions 1.5k Dec 29, 2022
The Laravel Boilerplate Project - https://laravel-boilerplate.com

Laravel Boilerplate (Current: Laravel 8.*) (Demo) Demo Credentials Admin: [email protected] Password: secret User: [email protected] Password: secret Offici

Anthony Rappa 5.4k Jan 4, 2023
A Laravel 5 package that switchs default Laravel scaffolding/boilerplate to AdminLTE template and Pratt Landing Page with Bootstrap 3.0

AdminLTE template Laravel package A Laravel package that switch default Laravel scaffolding / boilerplate to AdminLTE template with Bootstrap 3.0 and

Sergi Tur Badenas 1.8k Jan 3, 2023
Laravel Vue SPA, Bulma themed. For demo login use `[email protected]` & `password` -

Laravel Enso Hit the ground running when building your new Laravel SPA project with boilerplate and extra functionality out of the box! click on the p

Laravel Enso 1k Jan 3, 2023
High scalable boilerplate for Laravel - Vue using laravel-mix.

Why use this ? This boilerplate make developer easier to make monolith Laravel project which integrated with Vue.js and vue-router as default front-en

Carvel Saputra Martaloho 5 Sep 21, 2022
Gestor de Contraseñas basado en Laravel 8 + PHP 8 + MySQL 8. Self-hosted Password Manager based on Laravel 8 + PHP 8 + MySQL 8.

English Gestor de Contraseñas Esta aplicación permite una gestión completa de contraseñas para múltiples tipos de servicios (web, ssh, teléfonos, wifi

Lito 134 Jan 2, 2023
Laravel Vue SPA, Bulma themed. For demo login use `[email protected]` & `password` -

Laravel Enso Hit the ground running when building your new Laravel SPA project with boilerplate and extra functionality out of the box! click on the p

Laravel Enso 1k Jan 3, 2023
laravel/ui with auth scaffolding for Laravel 8

Legacy UI Presets with Auth scaffolding for Laravel 8 Introduction This project brings old Auth scaffolding to Laravel 8 for projects that cannot migr

Roger Vilà 56 Jul 17, 2022
Laravel Starter With Laravel, Vite, Vue 2, Inertia.js, Ziggy

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Oskars Germovs 1 Oct 29, 2021
Laravel Starter With Laravel, Vite, Vue 2, Inertia.js, Ziggy, Typescript

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Oskars Germovs 1 Oct 29, 2021
Base Laravel project with React and Laravel Sanctum authentication

About this project This is a base Laravel project with ReactJS frontend and Laravel Sanctum API authentication. You could read more about here. Instal

David Toth 8 Oct 25, 2022
Laravel and AngularJS Starter Application Boilerplate featuring Laravel 5.3 and AngularJS 1.5.8

?? Zemke/starter-laravel-angular has been upgraded to AngularJS 1.5.8. ?? Zemke/starter-laravel-angular has been upgraded to Laravel 5.3. You can pull

Florian Zemke 372 Nov 21, 2022