PHPackages                             syousoufov/alexa-skills-php - 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. syousoufov/alexa-skills-php

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

syousoufov/alexa-skills-php
===========================

Utility package to handle the tedium of setting up a custom web service for Alexa skills.

1.0(9y ago)850MITPHPPHP &gt;=5.6.5

Since Jul 26Pushed 9y ago4 watchersCompare

[ Source](https://github.com/SimantovYousoufov/alexa-skills-php)[ Packagist](https://packagist.org/packages/syousoufov/alexa-skills-php)[ RSS](/packages/syousoufov-alexa-skills-php/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (6)Versions (5)Used By (0)

Alexa Skills PHP Library [![Build Status](https://camo.githubusercontent.com/e842655bea29ffbd59778513df0d98da41264760ea95b74421bdccdbed3940f9/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f53696d616e746f76596f75736f75666f762f616c6578612d736b696c6c732d7068702f6d61737465722e7376673f7374796c653d666c6174)](https://travis-ci.org/SimantovYousoufov/alexa-skills-php)
======================================================================================================================================================================================================================================================================================================================================================================================

[](#alexa-skills-php-library-)

Utility package to handle the tedium of setting up a custom web service for Alexa skills.

Setup
-----

[](#setup)

1. Require the package `composer require syousoufov/alexa-skills-php`
2. Attach the service provider to `config/app.php`:

    ```
        // ..etc
        /*
         * Third Party Service Providers
         */
        AlexaPHP\Providers\AlexaServiceProvider::class,
        // ..etc
    ```
3. Publish the `alexa-skills-php` config with `php artisan vendor:publish --provider="AlexaPHP\Providers\AlexaServiceProvider"` and change the required values. The defaults for everything except `application_id` should work just fine.
4. Add the route middleware to the `$routeMiddleware` stack in `app/Http/Kernel.php`:

    ```
        /**
         * The application's route middleware.
         *
         * @var array
         */
        protected $routeMiddleware = [
            'alexa'    => \AlexaPHP\Middleware\AlexaRequestMiddleware::class,
        ];
    ```
5. Routes can now be served through the middleware:

    ```
    $router->group(
        ['middleware' => ['alexa'],], function (Router $router) {
            $router->post('alexa', 'AlexaSkillsController@handleAlexaRequest');
    });
    ```

Handling requests and returning responses
-----------------------------------------

[](#handling-requests-and-returning-responses)

Alexa requests can be routed to a single controller method which can act as a funnel to pass the request to appropriate handlers.

```
