PHPackages                             bonsaicms/serve-spa - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bonsaicms/serve-spa

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bonsaicms/serve-spa
===================

Package for serving SPA (Single-Page-Application) from Laravel

1.0.1(4y ago)0130MITPHPPHP ^7.3|^8.0

Since Nov 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/bonsaicms/serve-spa)[ Packagist](https://packagist.org/packages/bonsaicms/serve-spa)[ RSS](/packages/bonsaicms-serve-spa/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

Serve Single-Page-Application from Laravel
==========================================

[](#serve-single-page-application-from-laravel)

Introduction
------------

[](#introduction)

The purpose of this package is to simply serve an Single-Page-Application from your Laravel backend. By 'serve' we mean to provide some content (HTML document) on the defined route as the HTTP response.

By default, this package will register route `GET /spa` (with name `spa`) and the route will serve a static SPA content from view named `spa` (`resources/views/spa.blade.php` or `resources/views/spa.html` etc.).

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

[](#installation)

```
$ composer require bonsaicms/serve-spa

```

### Configuration

[](#configuration)

You can publish the configuration file with the following command:

```
$ php artisan vendor:publish --tag=serve-spa

```

Then you can customize your config file `app/config/serve-spa.php`.

#### Default Configuration file

[](#default-configuration-file)

*Notice, that you can define multiple SPAs in the `serve` configuration key.*

```
