> ## Documentation Index
> Fetch the complete documentation index at: https://kawax.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub Copilot SDK for Laravel

> Understand what the Laravel Copilot SDK provides and jump to the key guides for setup, sessions, tools, and runtime configuration.

GitHub Copilot SDK for Laravel is a community SDK that brings the official [GitHub Copilot SDK](https://github.com/github/copilot-sdk) workflow into Laravel applications.

You can call Copilot from Artisan commands, controllers, jobs, and other Laravel runtime contexts.

## What is specific to Laravel

This package adds Laravel-native ergonomics on top of an SDK-compatible layer:

* Facade-first API with `Copilot::run()` and `Copilot::start()`
* Laravel-style configuration via `config/copilot.php` and `.env`
* Integration points for Laravel Prompts, queues, and console UX
* Testing utilities such as `Copilot::fake()` and prompt assertions

## Usage examples

### Run single prompt

```php theme={null}
use Revolution\Copilot\Facades\Copilot;

$response = Copilot::run(prompt: 'Tell me something about Laravel.');
dump($response->content());
```

### Multiple prompts in a single session

```php theme={null}
use Revolution\Copilot\Contracts\CopilotSession;
use Revolution\Copilot\Facades\Copilot;

$content = Copilot::start(function (CopilotSession $session) {
    dump('Starting Copilot session: '.$session->id());

    $response = $session->sendAndWait(prompt: 'Tell me something about PHP.');
    dump($response->content());

    $response = $session->sendAndWait(prompt: 'Tell me something about Laravel.');
    dump($response->content());

    return $response->content();
});

dump($content);
```

### `copilot()` helper

```php theme={null}
use Revolution\Copilot\Contracts\CopilotSession;
use function Revolution\Copilot\copilot;

// If you specify a prompt as a string, it is the same as Copilot::run().
$response = copilot('Tell me something about Laravel.');

// If you pass a closure, it is the same as Copilot::start().
copilot(function (CopilotSession $session) {
    $response = $session->sendAndWait(prompt: 'Tell me something about PHP.');
});

// If you don't pass anything, it's the same as Facade.
dump(copilot()->client()->ping());
```

## Start here

<Columns cols={2}>
  <Card title="Getting started" href="/en/packages/laravel-copilot-sdk/getting-started">
    Build your first Copilot-powered Laravel app.
  </Card>

  <Card title="Authentication" href="/en/packages/laravel-copilot-sdk/auth">
    Configure GitHub login, token-based auth, or BYOK workflows.
  </Card>

  <Card title="Session config" href="/en/packages/laravel-copilot-sdk/session-config">
    Control tools, models, MCP servers, and session behavior.
  </Card>

  <Card title="SessionEvent" href="/en/packages/laravel-copilot-sdk/session-event">
    Understand Laravel-specific event helpers and lifecycle handling.
  </Card>

  <Card title="Permission request" href="/en/packages/laravel-copilot-sdk/permission-request">
    Review the permission flow to run tools with explicit approval.
  </Card>

  <Card title="Tools" href="/en/packages/laravel-copilot-sdk/tools">
    Define custom tools that Copilot can call.
  </Card>

  <Card title="Streaming" href="/en/packages/laravel-copilot-sdk/streaming">
    Handle incremental output and live assistant responses.
  </Card>

  <Card title="MCP" href="/en/packages/laravel-copilot-sdk/mcp">
    Connect MCP servers to extend capabilities.
  </Card>

  <Card title="Laravel Cloud" href="/en/packages/laravel-copilot-sdk/laravel-cloud">
    Run the SDK in Laravel Cloud environments.
  </Card>

  <Card title="Custom providers" href="/en/packages/laravel-copilot-sdk/custom-providers">
    Integrate additional provider and model strategies.
  </Card>
</Columns>

## Official repositories

* Laravel package: [invokable/laravel-copilot-sdk](https://github.com/invokable/laravel-copilot-sdk)
* Official SDK: [github/copilot-sdk](https://github.com/github/copilot-sdk)
