> ## 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 into the main guides for setup, sessions, tools, and runtime configuration.

The GitHub Copilot SDK for Laravel is a community SDK that lets you use the workflows of the official [GitHub Copilot SDK](https://github.com/github/copilot-sdk) from a Laravel application.

You can call Copilot from a variety of Laravel execution contexts, including Artisan commands, controllers, and jobs.

## Laravel-specific highlights

This package adds a Laravel-native feel on top of the SDK compatibility layer.

* A facade-based API centered on `Copilot::run()` and `Copilot::start()`.
* Laravel-style configuration through `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 a single prompt

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

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

### Run 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);
```

### The `copilot()` helper

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

// Passing a prompt is equivalent to Copilot::run()
$response = copilot('Tell me something about Laravel.');

// Passing a closure is equivalent to Copilot::start()
copilot(function (CopilotSession $session) {
    $response = $session->sendAndWait(prompt: 'Tell me something about PHP.');
});

// Passing nothing is equivalent to the facade
dump(copilot()->client()->ping());
```

## Start here

> [card] [Getting started](https://kawax.biz/en/packages/laravel-copilot-sdk/getting-started.md)
>
> Take your first steps with a Laravel app that uses Copilot.

> [card] [Authentication](https://kawax.biz/en/packages/laravel-copilot-sdk/auth.md)
>
> Configure GitHub sign-in, token authentication, and BYOK workflows.

> [card] [SessionConfig](https://kawax.biz/en/packages/laravel-copilot-sdk/session-config.md)
>
> Control tools, models, MCP servers, and session behavior.

> [card] [SessionEvent](https://kawax.biz/en/packages/laravel-copilot-sdk/session-event.md)
>
> Learn about Laravel-specific event helpers and lifecycle handling.

> [card] [Permission requests](https://kawax.biz/en/packages/laravel-copilot-sdk/permission-request.md)
>
> Learn about the permission flow for running tools with explicit approval.

> [card] [Tools](https://kawax.biz/en/packages/laravel-copilot-sdk/tools.md)
>
> Define custom tools that Copilot can call.

> [card] [Streaming](https://kawax.biz/en/packages/laravel-copilot-sdk/streaming.md)
>
> Handle incremental output and live responses.

> [card] [MCP](https://kawax.biz/en/packages/laravel-copilot-sdk/mcp.md)
>
> Connect MCP servers to extend Copilot's capabilities.

> [card] [Laravel Cloud](https://kawax.biz/en/packages/laravel-copilot-sdk/laravel-cloud.md)
>
> Run the SDK on Laravel Cloud.

> [card] [Official SDK compatibility layer](https://kawax.biz/en/packages/laravel-copilot-sdk/bare-usage.md)
>
> Use the same bare API as the official SDK from Laravel.

## 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)


## Related topics

- [GitHub Actions - GitHub Copilot SDK for Laravel](https://kawax.biz/en/packages/laravel-copilot-sdk/github-actions.md)
- [Laravel Cloud - GitHub Copilot SDK for Laravel](https://kawax.biz/en/packages/laravel-copilot-sdk/laravel-cloud.md)
- [Testing - GitHub Copilot SDK for Laravel](https://kawax.biz/en/packages/laravel-copilot-sdk/fake.md)
- [Authentication - GitHub Copilot SDK for Laravel](https://kawax.biz/en/packages/laravel-copilot-sdk/auth.md)
- [Getting started - GitHub Copilot SDK for Laravel](https://kawax.biz/en/packages/laravel-copilot-sdk/getting-started.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.