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

https://github.com/php-runtime/laravel

[READ ONLY]
https://github.com/php-runtime/laravel

laravel runtime

Last synced: 3 months ago
JSON representation

[READ ONLY]

Awesome Lists containing this project

README

          

# Laravel Runtime

A runtime for [Laravel](https://laravel.com/).

If you are new to the Symfony Runtime component, read more in the [main readme](https://github.com/php-runtime/runtime).

## Installation

```
composer require runtime/laravel
```

## Usage

The runtime will register automatically. You may "force" the runtime by defining
the environment variable `APP_RUNTIME` for your application.

```
APP_RUNTIME=Runtime\Laravel\Runtime
```

### Front controller

```php
// public/index.php

use Illuminate\Contracts\Http\Kernel;

define('LARAVEL_START', microtime(true));

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function (): Kernel {
static $app;

if (null === $app) {
$app = require dirname(__DIR__).'/bootstrap/app.php';
}

return $app->make(Kernel::class);
};
```

### Artisan

```php
// artisan

use Illuminate\Contracts\Console\Kernel;

define('LARAVEL_START', microtime(true));

require_once __DIR__.'/vendor/autoload_runtime.php';

return function (): Kernel {
static $app;

if (null === $app) {
$app = require __DIR__.'/bootstrap/app.php';
}

return $app->make(Kernel::class);
};
```