Installation &amp; setup | laravel-error-solutions | Spatie

 SPATIE

  Laravel Error Solutions
==========================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-error-solutions](https://spatie.be/docs/laravel-error-solutions/v1)  Installation &amp; setup

 Version   v1

 Other versions for crawler [v1](https://spatie.be/docs/laravel-error-solutions/v1)

  Installation &amp; setup
- [ Introduction ](https://spatie.be/docs/laravel-error-solutions/v1/introduction)
- [ Support us ](https://spatie.be/docs/laravel-error-solutions/v1/support-us)
- [ Requirements ](https://spatie.be/docs/laravel-error-solutions/v1/requirements)
- [ Installation &amp; setup ](https://spatie.be/docs/laravel-error-solutions/v1/installation-setup)
- [ Questions and issues ](https://spatie.be/docs/laravel-error-solutions/v1/questions-issues)
- [ Changelog ](https://spatie.be/docs/laravel-error-solutions/v1/changelog)
- [ About us ](https://spatie.be/docs/laravel-error-solutions/v1/about-us)

Basic usage
-----------

- [ Displaying solutions ](https://spatie.be/docs/laravel-error-solutions/v1/basic-usage/displaying-solutions)
- [ Runnable solutions ](https://spatie.be/docs/laravel-error-solutions/v1/basic-usage/runnable-solutions)
- [ AI powered solutions ](https://spatie.be/docs/laravel-error-solutions/v1/basic-usage/ai-powered-solutions)

Creating your own solutions
---------------------------

- [ Introduction ](https://spatie.be/docs/laravel-error-solutions/v1/creating-your-own-solutions/introduction)
- [ Creating a solution class ](https://spatie.be/docs/laravel-error-solutions/v1/creating-your-own-solutions/creating-a-solution-class)
- [ On exceptions ](https://spatie.be/docs/laravel-error-solutions/v1/creating-your-own-solutions/on-exceptions)
- [ Via a solution provider ](https://spatie.be/docs/laravel-error-solutions/v1/creating-your-own-solutions/via-a-solution-provider)

 Installation &amp; setup
========================

###  On this page

1. [ Publishing the config file ](#content-publishing-the-config-file)
2. [ Publishing the views files ](#content-publishing-the-views-files)

You can install the package via composer:

```
composer require spatie/laravel-error-solutions
```

Publishing the config file
--------------------------------------------------------------------------------------------------------------------------------------

Optionally, you can publish the `error-solutions` config file with this command.

```
php artisan vendor:publish --tag="error-solutions-config"
```

This is the content of the published config file:

```
return [
    /**
     * Display solutions on the error page
     */
    'enabled' => true,

    /*
     * Enable or disable runnable solutions.
     *
     * Runnable solutions will only work in local development environments,
     * even if this flag is set to true.
     */
    'enable_runnable_solutions' => true,

    /*
     * The solution providers that should be used to generate solutions.
     *
     * First we load the default PHP and Laravel defaults provided by
     * the base error solution package, then we load the ones you provide here.
     */
    'solution_providers' => [
        'php',
        'laravel',
        // your solution provider classes
    ],

    /*
     * When a key is set, we'll send your exceptions to Open AI to generate a solution
     */
    'open_ai_key' => env('ERROR_SOLUTIONS_OPEN_AI_KEY'),

    /*
     * This class is responsible for determining if a solution is runnable.
     *
     * In most cases, you can use the default implementation.
     */
    'runnable_solutions_guard' => Spatie\LaravelErrorSolutions\Support\RunnableSolutionsGuard::class,
];
```

Publishing the views files
--------------------------------------------------------------------------------------------------------------------------------------

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="error-solutions-views"
```

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
