PHPackages                             ez-it-solutions/app-serve - 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. ez-it-solutions/app-serve

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

ez-it-solutions/app-serve
=========================

A Laravel command for serving your application on the first available port

v1.0.0(8mo ago)01MITPHPPHP ^7.3|^8.0

Since Sep 7Pushed 8mo agoCompare

[ Source](https://github.com/ez-it-solutions/app-serve)[ Packagist](https://packagist.org/packages/ez-it-solutions/app-serve)[ RSS](/packages/ez-it-solutions-app-serve/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel App Serve Command
=========================

[](#laravel-app-serve-command)

[![Ez IT Solutions](https://github.com/ez-it-solutions.png)](https://github.com/ez-it-solutions.png)

A smart Laravel Artisan command for serving your application on the first available port with automatic browser opening.

📋 Overview
----------

[](#-overview)

The `app:serve` command provides an intelligent solution for serving your Laravel application. It automatically finds an available port within a specified range and launches your application server. It can also automatically open your default web browser to the application URL.

[![Command Output Example](https://camo.githubusercontent.com/a87ac0744532c4b9ce95df1b8ce55ca4a575117ef17c73c198b3394b69912573/68747470733a2f2f7669612e706c616365686f6c6465722e636f6d2f383030783430303f746578743d4170702b53657276652b436f6d6d616e642b53637265656e73686f74)](https://camo.githubusercontent.com/a87ac0744532c4b9ce95df1b8ce55ca4a575117ef17c73c198b3394b69912573/68747470733a2f2f7669612e706c616365686f6c6465722e636f6d2f383030783430303f746578743d4170702b53657276652b436f6d6d616e642b53637265656e73686f74)

✨ Features
----------

[](#-features)

- **Port Auto-Detection**: Automatically finds the first available port in a specified range
- **Browser Auto-Launch**: Opens your default browser to the application URL
- **Customizable Host**: Specify a custom host address to serve your application on
- **Configurable Port Range**: Set your preferred starting port and maximum attempts
- **Cross-Platform Support**: Works on Windows, macOS, and Linux

🚀 Installation
--------------

[](#-installation)

### Option 1: Install via Composer (Recommended)

[](#option-1-install-via-composer-recommended)

```
composer require ez-it-solutions/app-serve
```

That's it! The package will automatically register the command with Laravel.

#### Compatibility

[](#compatibility)

This package is compatible with Laravel 6.x, 7.x, 8.x, 9.x, and 10.x.

### Option 2: Manual Installation

[](#option-2-manual-installation)

1. Download the `AppServeCommand.php` file from our [GitHub repository](https://github.com/ez-it-solutions/app-serve)
2. Place it in your Laravel project at `app/Console/Commands/AppServeCommand.php`
3. Laravel's auto-discovery should automatically register the command

📦 Creating Your Own Package
---------------------------

[](#-creating-your-own-package)

If you want to create your own version of this package, follow these steps:

### 1. Set Up Package Structure

[](#1-set-up-package-structure)

Create the following directory structure:

```
app-serve/
├── src/
│   ├── Commands/
│   │   └── AppServeCommand.php
│   └── AppServeServiceProvider.php
├── composer.json
├── LICENSE
└── README.md

```

### 2. Create composer.json

[](#2-create-composerjson)

```
{
    "name": "ez-it-solutions/app-serve",
    "description": "A Laravel command for serving your application on the first available port",
    "type": "library",
    "license": "MIT",
    "authors": [
        {
            "name": "Ez IT Solutions",
            "email": "info@ez-it-solutions.com"
        }
    ],
    "require": {
        "php": "^7.3|^8.0"
    },
    "require-dev": {
        "laravel/framework": "^6.0|^7.0|^8.0|^9.0|^10.0"
    },
    "autoload": {
        "psr-4": {
            "Ez_IT_Solutions\\AppServe\\": "src/"
        }
    },
    "extra": {
        "laravel": {
            "providers": [
                "Ez_IT_Solutions\\AppServe\\AppServeServiceProvider"
            ]
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}
```

### 3. Create Service Provider

[](#3-create-service-provider)

Create a file at `src/AppServeServiceProvider.php`:

```
