{"id":19324895,"url":"https://github.com/spatie/laravel-help-space","last_synced_at":"2026-03-05T13:32:45.352Z","repository":{"id":65527584,"uuid":"580311458","full_name":"spatie/laravel-help-space","owner":"spatie","description":"Integrate HelpSpace in your Laravel app","archived":false,"fork":false,"pushed_at":"2026-01-31T09:45:58.000Z","size":283,"stargazers_count":23,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-31T22:27:01.370Z","etag":null,"topics":["helpspace","laravel","php"],"latest_commit_sha":null,"homepage":"https://spatie.be/open-source","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spatie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-20T08:48:39.000Z","updated_at":"2026-01-31T09:45:56.000Z","dependencies_parsed_at":"2025-05-12T22:31:13.193Z","dependency_job_id":"e4e101c1-8c1e-488b-a21c-9ebb1e3f165e","html_url":"https://github.com/spatie/laravel-help-space","commit_stats":{"total_commits":32,"total_committers":4,"mean_commits":8.0,"dds":0.4375,"last_synced_commit":"5475877ac95d88a64fe77bf5c830d7fad2f02db7"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":"spatie/package-skeleton-laravel","purl":"pkg:github/spatie/laravel-help-space","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-help-space","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-help-space/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-help-space/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-help-space/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spatie","download_url":"https://codeload.github.com/spatie/laravel-help-space/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-help-space/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30127866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T12:40:50.676Z","status":"ssl_error","status_checked_at":"2026-03-05T12:39:32.209Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["helpspace","laravel","php"],"created_at":"2024-11-10T02:07:25.684Z","updated_at":"2026-03-05T13:32:45.333Z","avatar_url":"https://github.com/spatie.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Integrate HelpSpace in your Laravel app\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-help-space.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-help-space)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/spatie/laravel-help-space/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/spatie/laravel-help-space/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-help-space.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-help-space)\n\n[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. \n\n![sidebar](https://github.com/spatie/laravel-help-space/blob/main/docs/sidebar.jpg?raw=true)\n\nHelpSpace 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.\n\nWhen installed, this is how you can respond to an incoming request from HelpSpace.\n\n```php\nuse Spatie\\HelpSpace\\Http\\Requests\\HelpSpaceRequest;\n\nHelpSpace::sidebar(function(HelpSpaceRequest $request) {\n    $user = User::firstWhere('email', $request-\u003eemail())\n    \n    if (! $user) {\n        return 'No user found';\n    }\n    \n    // any view of your own in which you render the html\n    // to be displayed at HelpSpace\n    return view('help-space.sidebar', compact('user'));\n})\n```\n\n## Support us\n\n[\u003cimg src=\"https://github-ads.s3.eu-central-1.amazonaws.com/laravel-help-space.jpg?t=1\" width=\"419px\" /\u003e](https://spatie.be/github-ad-click/laravel-help-space)\n\nWe 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).\n\nWe 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).\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require spatie/laravel-help-space\n```\n\nTo publish the config file and to create the `app/Providers/HelpSpaceServiceProvider.app` class in your app, run this command.\n\n```bash\nphp artisan help-space:install\n```\n\nThis is the contents of the published config file at `config/help-space.php` app:\n\n```php\nreturn [\n    /*\n     * The secret used to verify if the incoming HelpSpace secret is valid\n     */\n    'secret' =\u003e env('HELP_SPACE_SECRET'),\n\n    /*\n     * The package will automatically register this route to handle incoming\n     * requests from HelpSpace.\n     *\n     * You can set this to `null` if you prefer to register your route manually.\n     */\n    'url' =\u003e '/help-space',\n\n    /*\n     * These middleware will be applied on the automatically registered route.\n     */\n    'middleware' =\u003e [\n        Spatie\\HelpSpace\\Http\\Middleware\\IsValidHelpSpaceRequest::class,\n        'api',\n    ],\n];\n```\n\nNext, 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.\n\n![settings](https://github.com/spatie/laravel-help-space/blob/main/docs/settings.jpg?raw=true)\n\nThe package will automatically register a route at `/help-space`. This route [can be customized](#customizing-the-registered-route).\n\n## Usage\n\nIf you ran the install command from the section above, then your application a `HelpSpaceServiceProvider.php` service provider in `app/Providers`. This is the content.\n\n```php\nnamespace App\\Providers;\n\nuse Illuminate\\Support\\ServiceProvider;\nuse Spatie\\HelpSpace\\Facades\\HelpSpace;\nuse Spatie\\HelpSpace\\Http\\Requests\\HelpSpaceRequest;\n\nclass HelpSpaceServiceProvider extends ServiceProvider\n{\n    public function register()\n    {\n        HelpSpace::sidebar(function(HelpSpaceRequest $request) {        \n            return \"HTML about {$request-\u003eemail()}\";\n        });\n    }\n}\n```\n\nThe 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.\n\nInstead of returning a string, you can also return a view.\n\n```php\nHelpSpace::sidebar(function(HelpSpaceRequest $request) {\n    $user = User::firstWhere('email', $request-\u003eemail());\n    \n    return view('your-own-view', compact('user'));        \n}\n```\n\n## Preview the content of the sidebar\n\nWhen 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.\n\nTo see the HTML for a given email address, you can use the `help-space:render-sidebar` command.\n\n```bash\n# returns the HTML for the given email address\nphp artisan help-space:render-sidebar --email=john@example.com\n```\n\n## Customizing the registered route\n\nThe package will automatically register a route at `/help-space`. You can change this value in the `help-space.php` config file.\n\nAlternatively, you can register your own route.\n\nFirst, you must set the `url` key in the `help-space.php` config file to `null`\n\nNext, 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.\n\n```php\n// in a routes file, preferable in routes/api.php\n\nRoute::helpSpaceSidebar('your-custom-segment');\n```\n\nThe 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.)\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Freek Van der Herten](https://github.com/freekmurze)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Flaravel-help-space","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspatie%2Flaravel-help-space","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Flaravel-help-space/lists"}