PHPackages                             spatie/laravel-help-space - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. spatie/laravel-help-space

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

spatie/laravel-help-space
=========================

Integrate Helpspace in your Laravel app

1.3.0(2mo ago)2333.7k↓33.1%1MITPHPPHP ^8.3CI passing

Since Jan 6Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/spatie/laravel-help-space)[ Packagist](https://packagist.org/packages/spatie/laravel-help-space)[ Docs](https://github.com/spatie/laravel-help-space)[ RSS](/packages/spatie-laravel-help-space/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (24)Versions (9)Used By (0)

Integrate HelpSpace in your Laravel app
=======================================

[](#integrate-helpspace-in-your-laravel-app)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9ab6e1840c0b290c776befa196055430f3fabf6554f72c65b853a5dc6e40b48d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d68656c702d73706163652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-help-space)[![GitHub Tests Action Status](https://camo.githubusercontent.com/a082de12165ebcfed8afd7ee628d24bb8c5a7d86a0b37ab0052d0d6ce8affbe5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d68656c702d73706163652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/spatie/laravel-help-space/actions?query=workflow%3Arun-tests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/35cbe9eb8482d5f8f71381550f0ee31f1f1f872e19703c072b0de076abb75e04/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d68656c702d73706163652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-help-space)

[HelpSpace](https://helpspace.com) is a beautiful help desk service. One of its features is that it can display a sidebar with extra information about the person that opened a ticket.

[![sidebar](https://github.com/spatie/laravel-help-space/raw/main/docs/sidebar.jpg?raw=true)](https://github.com/spatie/laravel-help-space/blob/main/docs/sidebar.jpg?raw=true)

HelpSpace sends a request to your app to get the HTML content to populate that sidebar. Our package makes it easy to validate if an incoming request from HelpSpace is valid and allows you to respond to it.

When installed, this is how you can respond to an incoming request from HelpSpace.

```
use Spatie\HelpSpace\Http\Requests\HelpSpaceRequest;

HelpSpace::sidebar(function(HelpSpaceRequest $request) {
    $user = User::firstWhere('email', $request->email())

    if (! $user) {
        return 'No user found';
    }

    // any view of your own in which you render the html
    // to be displayed at HelpSpace
    return view('help-space.sidebar', compact('user'));
})
```

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/31343bd3208584904bade90221af627e7b9721fe33b3864d3603a1b3724a1af0/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d68656c702d73706163652e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-help-space)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require spatie/laravel-help-space
```

To publish the config file and to create the `app/Providers/HelpSpaceServiceProvider.app` class in your app, run this command.

```
php artisan help-space:install
```

This is the contents of the published config file at `config/help-space.php` app:

```
return [
    /*
     * The secret used to verify if the incoming HelpSpace secret is valid
     */
    'secret' => env('HELP_SPACE_SECRET'),

    /*
     * The package will automatically register this route to handle incoming
     * requests from HelpSpace.
     *
     * You can set this to `null` if you prefer to register your route manually.
     */
    'url' => '/help-space',

    /*
     * These middleware will be applied on the automatically registered route.
     */
    'middleware' => [
        Spatie\HelpSpace\Http\Middleware\IsValidHelpSpaceRequest::class,
        'api',
    ],
];
```

Next, In your `.env` file, you must set a new env-variable called `HELP_SPACE_SECRET` to a random string. At [HelpSpace](https://helpspace.com) you must navigate to the "Custom Ticket sidebar" in the integration settings. There you must input that random string. This secret will be used to verify if an incoming request is really coming from HelpSpace.

[![settings](https://github.com/spatie/laravel-help-space/raw/main/docs/settings.jpg?raw=true)](https://github.com/spatie/laravel-help-space/blob/main/docs/settings.jpg?raw=true)

The package will automatically register a route at `/help-space`. This route [can be customized](#customizing-the-registered-route).

Usage
-----

[](#usage)

If you ran the install command from the section above, then your application a `HelpSpaceServiceProvider.php` service provider in `app/Providers`. This is the content.

```
namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Spatie\HelpSpace\Facades\HelpSpace;
use Spatie\HelpSpace\Http\Requests\HelpSpaceRequest;

class HelpSpaceServiceProvider extends ServiceProvider
{
    public function register()
    {
        HelpSpace::sidebar(function(HelpSpaceRequest $request) {
            return "HTML about {$request->email()}";
        });
    }
}
```

The callable in `sidebar` will be executed whenever HelpSpace sends a request to your app. The `email()` method of the given `HelpSpaceRequest` will contain the email address of the person that opened the ticket.

Instead of returning a string, you can also return a view.

```
HelpSpace::sidebar(function(HelpSpaceRequest $request) {
    $user = User::firstWhere('email', $request->email());

    return view('your-own-view', compact('user'));
}
```

Preview the content of the sidebar
----------------------------------

[](#preview-the-content-of-the-sidebar)

When working on the view that returns the HTML of the sidebar, it can be handy to preview it locally, instead of letting HelpScout sending requests.

To see the HTML for a given email address, you can use the `help-space:render-sidebar` command.

```
# returns the HTML for the given email address
php artisan help-space:render-sidebar --email=john@example.com
```

Customizing the registered route
--------------------------------

[](#customizing-the-registered-route)

The package will automatically register a route at `/help-space`. You can change this value in the `help-space.php` config file.

Alternatively, you can register your own route.

First, you must set the `url` key in the `help-space.php` config file to `null`

Next, you must add this to your routes file, preferably `routes/api.php` so that your app doesn't start a session when a new request comes in from HelpSpace.

```
// in a routes file, preferable in routes/api.php

Route::helpSpaceSidebar('your-custom-segment');
```

The above route will register a route with URL `https://yourdomain.com/api/your-custom-segment` (when you registered it in the api.php routes file.)

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance88

Actively maintained with recent releases

Popularity38

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 54.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~291 days

Total

5

Last Release

62d ago

PHP version history (3 changes)1.0.0PHP ^8.1

1.1.0PHP ^8.2

1.3.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (46 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (18 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (14 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (3 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (2 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (2 commits)")

---

Tags

helpspacelaravelphpspatielaravellaravel-help-space

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/spatie-laravel-help-space/health.svg)

```
[![Health](https://phpackages.com/badges/spatie-laravel-help-space/health.svg)](https://phpackages.com/packages/spatie-laravel-help-space)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[spatie/laravel-support-bubble

A non-intrusive support chat bubble that can be displayed on any page

391173.6k](/packages/spatie-laravel-support-bubble)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[spatie/laravel-rdap

Perform RDAP queries in a Laravel app

72108.3k2](/packages/spatie-laravel-rdap)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
