THE PUBLIC SURFACE

An explicit API.
A useful reference.

The core entry points available in the v0.1 preview.
For complete type signatures, follow the linked source.

Elang\Application

View source ↗
  • create(string $basePath): Application
  • provider(ServiceProvider $provider): self
  • middleware(string ...$classes): self
  • handle(Request $request): Response
  • run(): void

Elang\Routing\Router

View source ↗
  • get(string $path, callable|array|string $handler, ?string $name = null): Route
  • post / put / patch / delete: same arguments as get
  • group(string $prefix, array $middleware, callable $routes): void
  • url(string $name, array $parameters = []): string

Elang\Container\Container

View source ↗
  • bind(string $id, Closure|string $factory, bool $shared = false): void
  • singleton(string $id, Closure|string $factory): void
  • instance(string $id, mixed $instance): void
  • get(string $id): mixed
  • has(string $id): bool

Elang\Http\Response

View source ↗
  • json(mixed $data, int $status = 200, array $headers = []): JsonResponse
  • html(string $html, int $status = 200): Response
  • redirect(string $path, int $status = 302): RedirectResponse

Elang\Database\Database

View source ↗
  • connection(): Doctrine DBAL Connection
  • table(string $table): Doctrine DBAL QueryBuilder
  • transaction(callable $callback): mixed

Elang\Validation\Validator

View source ↗
  • validate(array $data, array $rules): array

Elang\View\View

View source ↗
  • render(string $template, array $data = [], int $status = 200): Response
  • engine(): Twig Environment

Elang\Security\Password

View source ↗
  • hash(string $password): string
  • verify(string $password, string $hash): bool
  • needsRehash(string $hash): bool

Elang\Security\Encryption

View source ↗
  • encrypt(string $value): string
  • decrypt(string $value): string

Elang\Queue\Queue

View source ↗
  • push(string $name, array $payload = [], int $delay = 0): string
  • workOne(): bool
  • failures(): array
  • retry(string $id): bool

Elang\Realtime\Events

View source ↗
  • publish(string $channel, string $event, array $payload): int
  • after(string $channel, int $id = 0, int $limit = 100): array

Elang\Data\Models

View source ↗
  • of(string $model): Repository
  • hasMany(Model $parent, string $related, string $foreignKey, string $localKey): Repository

Elang\Auth\Gate

View source ↗
  • define(string $ability, callable $policy): void
  • allows(string $ability, User $user, mixed ...$arguments): bool

Elang\Security\Csrf

View source ↗
  • token(Request $request): string
  • verify(Request $request, string $token): bool
Search Elang documentation

Start typing to find your next step.