PHPackages                             ajaydhakal/laravel-host - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. ajaydhakal/laravel-host

ActiveLibrary[CLI &amp; Console](/categories/cli)

ajaydhakal/laravel-host
=======================

Serve Laravel apps on the local network using php artisan host.

00PHP

Since Jun 19Pushed todayCompare

[ Source](https://github.com/ajaydhakal1/laravel-host)[ Packagist](https://packagist.org/packages/ajaydhakal/laravel-host)[ RSS](/packages/ajaydhakal-laravel-host/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

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
------------

[](#installation)

You can install the package via Composer:

```
composer require ajaydhakal/laravel-host
```

The package will automatically register its service provider using Laravel's package auto-discovery.

Usage
-----

[](#usage)

To start serving your application on your local network:

```
php artisan host
```

This will run the built-in development server and output details similar to:

```
Laravel Host is running

Local:
  http://127.0.0.1:8000

Network:
  http://192.168.1.12:8000

Press Ctrl+C to stop the server.

Make sure your firewall allows incoming connections on port 8000.
The terminal must remain open while serving.

```

### Custom Port

[](#custom-port)

You can specify a custom port with the `--port` option:

```
php artisan host --port=8080
```

### Custom Host

[](#custom-host)

You can customize the host bind address with the `--host` option (defaults to `0.0.0.0`):

```
php artisan host --host=0.0.0.0 --port=8080
```

### Production Warning

[](#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:

```
php artisan host --force
```

Configuration
-------------

[](#configuration)

If you want to customize default settings, you can publish the configuration file:

```
php artisan vendor:publish --tag=laravel-host-config
```

This will create a `config/host.php` file:

```
return [
    'host' => env('LARAVEL_HOST_ADDRESS', '0.0.0.0'),
    'port' => env('LARAVEL_HOST_PORT', 8000),
    'allow_production' => env('LARAVEL_HOST_ALLOW_PRODUCTION', false),
];
```

You can define these settings directly in your `.env` file:

```
LARAVEL_HOST_ADDRESS=0.0.0.0
LARAVEL_HOST_PORT=8000
LARAVEL_HOST_ALLOW_PRODUCTION=false
```

Troubleshooting &amp; Important Notes
-------------------------------------

[](#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 to `127.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
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/375e4fe320bda82f873fbad3ffb77f2faea3121689307b364792d9cad89d2ad0?d=identicon)[mr-ajay](/maintainers/mr-ajay)

---

Top Contributors

[![ajaydhakal1](https://avatars.githubusercontent.com/u/131642635?v=4)](https://github.com/ajaydhakal1 "ajaydhakal1 (1 commits)")

### Embed Badge

![Health badge](/badges/ajaydhakal-laravel-host/health.svg)

```
[![Health](https://phpackages.com/badges/ajaydhakal-laravel-host/health.svg)](https://phpackages.com/packages/ajaydhakal-laravel-host)
```

###  Alternatives

[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24726.4M22](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

13045.3M6.2k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

596920.8k12](/packages/php-tui-php-tui)[styleci/cli

The CLI tool for StyleCI

71464.1k9](/packages/styleci-cli)[winbox/args

Windows command-line formatter

20718.9k21](/packages/winbox-args)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
