lumenize 0.2.5

Laravel integration for Claviron hosts, independent of their server boot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Laravel integration for applications that own a Claviron Edge.

use claviron::runtime::{AppState, Register, registry};

/// Install the Laravel config parser and, with `broadcast`, the native
/// broadcaster and its Edge routes. Call during bootstrap after Edge has
/// registered its host registry. This does not start a PHP application.
///
/// A host with its own broadcast catalog can register it before this call.
/// The auth event relay remains available through `crate::auth::register`.
pub fn register(state: &AppState) -> registry::Result<()> {
    #[cfg(feature = "broadcast")]
    {
        claviron_broadcast::edge::register(state)?;
        crate::LaravelBroadcastProvider::register(state)?;
    }
    crate::LaravelConfigProvider::register(state)
}