Download the PHP package ajaydhakal/laravel-host without Composer
On this page you can find all versions of the php package ajaydhakal/laravel-host. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ajaydhakal/laravel-host
More information about ajaydhakal/laravel-host
Files in ajaydhakal/laravel-host
Package laravel-host
Short Description Serve Laravel apps on the local network using php artisan host.
License MIT
Informations about the package laravel-host
Laravel Host
Serve your current Laravel application on your local network/LAN by default, making it easily accessible from other devices (like smartphones, tablets, or other development machines) on the same Wi-Fi.
Installation
You can install the package via Composer:
The package will automatically register its service provider using Laravel's package auto-discovery.
Usage
To start serving your application on your local network:
This will run the built-in development server and output details similar to:
Custom Port
You can specify a custom port with the --port option:
Custom Host
You can customize the host bind address with the --host option (defaults to 0.0.0.0):
Production Warning
By default, the command prevents running in a production environment (APP_ENV=production) to safeguard against accidental exposure. If you explicitly want to run it in production, pass the --force option:
Configuration
If you want to customize default settings, you can publish the configuration file:
This will create a config/host.php file:
You can define these settings directly in your .env file:
Troubleshooting & Important Notes
- Local Development Only: This package uses PHP's built-in web server. It is meant only for local development and testing. Do not use it in place of production web servers like Nginx, Apache, or PHP-FPM.
- Same Wi-Fi/LAN: To access the application on other devices using the Network URL, all devices must be connected to the exact same Wi-Fi network or Local Area Network (LAN).
- Firewall Restrictions: If other devices are unable to connect to the Network URL, verify your machine's firewall settings. Ensure that incoming connections on the selected port (e.g.,
8000) are allowed. - IP Bind (0.0.0.0 vs 127.0.0.1): To listen on all network interfaces, the host must be set to
0.0.0.0. If set to127.0.0.1, the server will only accept requests from the local machine. - Busy Ports: If the selected port is already in use by another service, the command will automatically detect it and suggest trying another port (e.g.,
8081).
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-host with dependencies
illuminate/support Version ^11.0|^12.0|^13.0
symfony/process Version ^6.0|^7.0|^8.0