An API Storeden connector for Laravel

dev-master 2019-01-02 11:09 UTC

This package is auto-updated.

Last update: 2024-03-29 03:57:53 UTC


Warning: this packaging is in development mode!

An API Storeden SDK for Laravel.

This package satisfy Authorization Endpoint required in online Storeden setting customized app profile

See: Storeden doc


Add Storeden Laravel API connector to your project:

composer require velvetmedia/storeden-laravel-api-connettor

See into routes.php for getting right routes to insert in the Storeden setting form

Iframe and X-Frame-Options

Storeden use iframe tag for injected your app in his backoffice.

So, if you use Forge, edit Nginx file like this:

add_header X-Frame-Options "allow-from https://[UUID]";

where [UUID] is you Merchant id, otherwise if your app is developed for any stores:

add_header X-Frame-Options "ALLOWALL";


Add a new middleware to kernel.php in your app, like:

protected $routeMiddleware = [
    'auth.sdk.storeden' => \Velvetmedia\StoredenLaravelAPIConnector\Middleware\AuthSdkStoredenMiddleware::class,

Use like this:

Route::get('products', 'ProductsController@index')->middleware('auth.sdk.storeden');


A middleware, need var instance into query string. Provide your route like this:

<a href="{{ route('storeden.endpoint.embed.test', ['instance' => request()->get('instance')]) }}">EMBED TEST</a>

Custom embed welcome views

For customizing this package views launch command:

php artisan vendor:publish

And select

Provider: Velvetmedia\StoredenLaravelAPIConnector\StoredenApiConnectorServiceProvider

Overwrite route for "embed" endpoint, like:

// Overwrite original route
Route::get('endpoint/embed', function () {
    return view('storeden.welcome');

Or with another custom controller and another custom view.

Access to API

Once activated, the middleware can be accessed by request, like:

public function embed(Request $request)
    // SDK connection by middleware
    return $request->sdk->api('/store/info.json', 'GET');