PHPackages                             m7md-5ttab/laravel-shared - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. m7md-5ttab/laravel-shared

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

m7md-5ttab/laravel-shared
=========================

Production-grade Laravel shared hosting deployment toolkit for readiness checks, safe publishing, and rollback workflows.

v1.1.0(3w ago)410↓100%1MITPHPPHP ^8.2

Since May 14Pushed 3w agoCompare

[ Source](https://github.com/M7md-5ttab/laravel-shared)[ Packagist](https://packagist.org/packages/m7md-5ttab/laravel-shared)[ RSS](/packages/m7md-5ttab-laravel-shared/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

Laravel Shared
==============

[](#laravel-shared)

Deploy Laravel apps to shared hosting with one Artisan command.

`m7md-5ttab/laravel-shared` is a deployment toolkit for Laravel 11+ applications running on traditional shared hosting such as cPanel, Hostinger, Namecheap, GoDaddy, DirectAdmin, and similar environments.

It helps you publish a Laravel app beside `public_html` without manually copying files, patching `index.php`, or guessing whether symlinks will work on the server.

Why Use It
----------

[](#why-use-it)

- One command for checking, preparing, and deploying
- Safe `--dry-run` mode before any real changes
- Automatic handling for `public_html`, `public/storage`, and writable Laravel directories
- Supports both symlink and copy deployments
- Keeps deployment manifests and rollback data
- Optional Git snapshot and tag workflows

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11, 12, or 13
- Git is optional for basic deployments, but strongly recommended for snapshots, tags, and safer rollbacks

Installation
------------

[](#installation)

```
composer require m7md-5ttab/laravel-shared
```

Optional: publish the configuration file.

```
php artisan vendor:publish --tag=hosting-shared-config
```

Laravel package discovery will register:

- `php artisan hosting:check`
- `php artisan hosting:run`
- `php artisan hosting:rollback`

Quick Start
-----------

[](#quick-start)

Preview the deployment first:

```
php artisan hosting:run --dry-run --target=/home/account/public_html
```

Run the real deployment:

```
php artisan hosting:run --target=/home/account/public_html
```

Rollback the latest recorded deployment if needed:

```
php artisan hosting:rollback
```

If the package can already detect your `public_html` directory, you can omit `--target`.

Typical Shared Hosting Layout
-----------------------------

[](#typical-shared-hosting-layout)

This package is designed for the common setup where your Laravel app lives outside the web root and only public assets are exposed:

```
/home/account/
├── laravel-app/
└── public_html/

```

During deployment, the package syncs your Laravel `public/` directory into the target web root and patches `public_html/index.php` so it loads the app from the correct location.

Commands
--------

[](#commands)

### `php artisan hosting:check`

[](#php-artisan-hostingcheck)

Runs a readiness report without changing files.

It checks things like:

- PHP version and required extensions
- Laravel version
- Git availability and repository status
- `.gitignore` coverage
- symlink support
- `public/storage` status
- writable permissions for `storage` and `bootstrap/cache`
- shared-hosting target detection
- provider-specific hints for common shared hosts

Use this before your first deployment if you want a quick health check.

### `php artisan hosting:run`

[](#php-artisan-hostingrun)

This is the main workflow. It:

1. runs readiness checks
2. applies conservative automatic fixes inside your project
3. reruns readiness checks
4. shows a deployment summary
5. asks once before the real deployment
6. deploys using symlink or copy mode

Common options:

- `--symlink`
- `--copy`
- `--target=/absolute/path/to/public_html`
- `--tag`
- `--tag-name=custom-tag`
- `--dry-run`
- `--force`

Examples:

```
php artisan hosting:run --dry-run
php artisan hosting:run --copy
php artisan hosting:run --target=/home/account/public_html --tag
php artisan hosting:run --symlink --force
```

Useful notes:

- `--dry-run` previews automatic fixes and deployment actions without changing files
- `--force` skips the final deployment confirmation
- `--tag` and `--tag-name` require Git

What `hosting:run` can fix automatically:

- initialize Git when Git is installed and the project is not yet a repository
- offer to configure a local Git identity when `user.name` or `user.email` is missing for snapshot commits
- append missing Laravel-related `.gitignore` rules
- create `public/storage`
- apply writable permissions to Laravel runtime directories
- create the initial Git snapshot commit only when the workflow initialized the repository itself

What stays manual:

- installing Git on the machine
- adding a Git remote
- enabling symlink support at the hosting provider level
- choosing a valid deployment path when your hosting layout is unusual

### `php artisan hosting:rollback`

[](#php-artisan-hostingrollback)

Use rollback in one of these ways:

- no arguments: clean the latest recorded deployment and remove package-managed artifacts
- `--snapshot=...`: clean a specific recorded deployment snapshot
- `--tag=...`: roll the Git repository back to a specific deployment tag

Examples:

```
php artisan hosting:rollback
php artisan hosting:rollback --snapshot=hosting-deploy-2026-05-14-001
php artisan hosting:rollback --tag=hosting-deploy-2026-05-14-003
php artisan hosting:rollback --tag=hosting-deploy-2026-05-14-003 --force
```

Notes:

- rollback always asks for confirmation
- `--force` allows rollback to continue even when Git has uncommitted changes
- tag-based rollback is for source-control recovery
- default and snapshot rollback are for cleaning deployment artifacts created by this package

Deployment Modes
----------------

[](#deployment-modes)

### Symlink Mode

[](#symlink-mode)

Recommended when your host allows symlinks.

- syncs `public/` into the target web root
- patches `index.php` to load Laravel from the correct base path
- creates `public_html/storage` as a symlink to `storage/app/public`

### Copy Mode

[](#copy-mode)

Recommended when symlinks are disabled or unreliable.

- syncs `public/` into the target web root
- patches `index.php` to load Laravel from the correct base path
- copies public storage assets into `public_html/storage`

If you do not choose a mode, the package prefers symlink mode first and falls back to copy mode automatically when needed. If you explicitly pass `--symlink`, it will not silently switch to copy mode.

Deployment Records
------------------

[](#deployment-records)

During real deployments, the package stores:

- `storage/app/hosting-shared/manifests`
- `storage/app/hosting-shared/backups`
- `storage/logs/hosting-shared.log`

These records are used for cleanup-based rollbacks and deployment history.

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

[](#configuration)

Publish the config if you want to customize behavior:

```
php artisan vendor:publish --tag=hosting-shared-config
```

Useful settings in `config/hosting-shared.php` include:

- `public_html_candidates`
- `permissions.directory_mode`
- `deployment.tag_prefix`
- `deployment.preserve_paths`

By default, `.well-known` is preserved in the target directory.

Troubleshooting
---------------

[](#troubleshooting)

### `public_html` was not detected

[](#public_html-was-not-detected)

Pass the target explicitly:

```
php artisan hosting:run --target=/home/account/public_html
```

### Symlink deployment failed

[](#symlink-deployment-failed)

Retry in copy mode:

```
php artisan hosting:run --copy
```

Some shared hosts disable symlink creation entirely.

### Git is unavailable

[](#git-is-unavailable)

Basic deployment can still work, but Git snapshot commits and tag workflows will be skipped or blocked depending on the command options you use.

If you want deployment tags, install Git and rerun with `--tag` or `--tag-name`.

Recommendations
---------------

[](#recommendations)

- Keep the Laravel app outside `public_html` whenever your host allows it
- Run `--dry-run` before the first real deployment
- Prefer copy mode when symlink support is inconsistent on your host
- Keep `.well-known` preserved if your host uses it for SSL challenges
- Use Git tags when you want a clearer rollback history

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance94

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

27d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f973e581032cfa64ee94a0826b081b10edbaa9d224f09f818d42535845eba563?d=identicon)[M7md-5ttab](/maintainers/M7md-5ttab)

---

Top Contributors

[![medokhatabkhatab-ux](https://avatars.githubusercontent.com/u/242325217?v=4)](https://github.com/medokhatabkhatab-ux "medokhatabkhatab-ux (2 commits)")

---

Tags

laravelartisandeploymenthostingercpanelshared hosting

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/m7md-5ttab-laravel-shared/health.svg)

```
[![Health](https://phpackages.com/badges/m7md-5ttab-laravel-shared/health.svg)](https://phpackages.com/packages/m7md-5ttab-laravel-shared)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

20432.2M1.5k](/packages/illuminate-queue)[moonshine/moonshine

Laravel administration panel

1.3k239.9k72](/packages/moonshine-moonshine)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4721.5k](/packages/erag-laravel-lang-sync-inertia)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

249143.0k](/packages/erag-laravel-disposable-email)[thecodeholic/laravel-hostinger-deploy

Laravel package for automated Hostinger deployment with GitHub Actions support

647.1k](/packages/thecodeholic-laravel-hostinger-deploy)

PHPackages © 2026

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