Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ge-tracker/octane-helpers

Helper code for Laravel Octane installations
https://github.com/ge-tracker/octane-helpers

Last synced: 11 days ago
JSON representation

Helper code for Laravel Octane installations

Awesome Lists containing this project

README

        

# Octane Helpers

This package will provide some basic functionality to our various Laravel Octane projects.

## Installation

```bash
$ composer require ge-tracker/octane-helpers
```

After installation, the `BootApplication` class should be added to the `RequestReceived` listener in `octane.php`:

```php
'listeners' => [
...

RequestReceived::class => [
...Octane::prepareApplicationForNextOperation(),
...Octane::prepareApplicationForNextRequest(),
\GeTracker\OctaneHelpers\Listeners\BootApplication::class,
],
```

## Routing

We can make use of Octane's builtin routing to serve requests that bypass Laravel's router (and middleware) to serve data very fast.

With a basic controller that extends `OctaneController`:

```php