PHPackages                             oriondevelops/larashared - 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. [API Development](/categories/api)
4. /
5. oriondevelops/larashared

ActiveLibrary[API Development](/categories/api)

oriondevelops/larashared
========================

Shared Hosting Deployment Management for Laravel

v1.0.0(3y ago)1081MITPHPPHP ^8.1

Since Oct 16Pushed 3y ago2 watchersCompare

[ Source](https://github.com/oriondevelops/larashared)[ Packagist](https://packagist.org/packages/oriondevelops/larashared)[ Docs](https://github.com/oriononairdev/larashared)[ RSS](/packages/oriondevelops-larashared/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (2)Used By (0)

[![Larashared](larashared.png)](larashared.png)

---

Larashared
==========

[](#larashared)

[![Latest Version on Packagist](https://camo.githubusercontent.com/64449eea2220fe1db4428261fad441a55bbc3314dba8a525a84eb69c9263afe0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f72696f6e646576656c6f70732f6c6172617368617265642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oriondevelops/larashared)[![Total Downloads](https://camo.githubusercontent.com/e61f382dbf620b09965559f3bcdd326dbf5395c4578c7efa741dabd5d9caeb52/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f72696f6e646576656c6f70732f6c6172617368617265642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oriondevelops/larashared)

#### Shared Hosting Deployment Management for Laravel

[](#shared-hosting-deployment-management-for-laravel)

Larashared is a deployment guide and a helper api in shared hosting environments where ssh access is not available.

It allows using basic Artisan commands through an API by sending post requests with a bearer token for authorization. The package can be installed via composer and the configuration file can be published to modify the API path and the token. The package has several endpoints for different Artisan commands like optimizing, enabling/disabling maintenance mode, cache operations, etc.

Disclaimer
----------

[](#disclaimer)

Deploying Laravel on shared hosting is not recommended. Check out this article by Pardeep Kumar:

[Here’s Why You Should Stay Away From Laravel Shared Hosting](https://www.cloudways.com/blog/stay-away-from-laravel-shared-hosting/)

Support me
----------

[](#support-me)

[!["Buy Me A Coffee"](https://camo.githubusercontent.com/9f44ce2dc3b3eecdd02598900866ffc518801df1932849703dae1e5ce5031070/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f6f72616e67655f696d672e706e67)](https://www.buymeacoffee.com/oriondevelops)
or send your love &amp; energy &lt;3

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

[](#installation)

You can install the package via composer:

```
composer require oriondevelops/larashared
```

You can publish the config file with:

```
php artisan vendor:publish --tag="larashared-config"
```

This is the contents of the published config file:

```
return [
    /*
    |--------------------------------------------------------------------------
    | API Path
    |--------------------------------------------------------------------------
    |
    | This is the URI path where API will be accessible from. Feel free to
    | change this path to anything you like.
    |
    */
    'path' => env('LARASHARED_PATH', 'larashared'),

    /*
    |--------------------------------------------------------------------------
    | Token
    |--------------------------------------------------------------------------
    |
    | This value is the token the API will be accessible with.
    |
    */
    'token' => env('LARASHARED_TOKEN', '1|gnmyXCnxxN23MAMxx2dCv5BgT4cUOo6ZWSdUPqWT'),
];
```

Deployment
----------

[](#deployment)

- Make a fresh copy of your application 🎁
- Build your production assets 🔧

    ```
    # For example
    npm install

    npm run build
    ```
- Install dependencies excluding dev packages ↙️

    ```
    composer install --optimize-autoloader --no-dev
    ```

    ```
     npm install --omit=dev
    ```
- Create the .env and fill it according to your shared hosting settings and add `LARASHARED_TOKEN` to your .env file 🔁
- You can now copy the default htaccess file and set a random token by the `larashared:install` Artisan command ⚙️

    ```
    php artisan larashared:install
    ```
- Move your application with all files and folders to your root folder by FTP 🚀
- (Optional) Run your migrations using [migration endpoint](#migrate) ↗️

Usage
-----

[](#usage)

### Authorization

[](#authorization)

```
Authorization: Bearer

```

You can now send post requests to the endpoints using your token.

`POST /larashared/optimize`

```
