wetcat-studios / litterbox-api by agoransson

The Litterbox backend.
234
0
2
Package Data
Maintainer Username: agoransson
Maintainer Contact: andreasgoransson0@gmail.com (Andreas Göransson)
Package Create Date: 2015-10-16
Package Last Update: 2016-04-10
Language: PHP
License: Apache-2.0
Last Refreshed: 2024-11-14 15:18:43
Package Statistics
Total Downloads: 234
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Under development!

#install

This assumes you've already installed Laravel 5.1.19 (neoeloquent is not compatible with later changes to the builder in Laravel)

  1. Install package with composer require wetcat/litterbox-api dev-master

  2. Add provider

Wetcat\Litterbox\LitterboxServiceProvider::class,
  1. Publish config php artisan vendor:publish and modify to suit your Neo server.

  2. Update configs.

  3. Add datbase settings

'default' => 'neo4j',
'connections' => [
  'neo4j' => [
    'driver' => 'neo4j',
    'host'   => 'localhost',
    'port'   => '7474',
    'username' => null,
    'password' => null
  ]
]
  1. Register middleware in App\Http\Kernel.php
protected $routeMiddleware = [
  'cors'                  => Barryvdh\Cors\HandleCors::class,
  'litterbox-guest'       => \Wetcat\Litterbox\Middleware\Guest::class,
  'litterbox-auth'        => \Wetcat\Litterbox\Middleware\Auth::class,
  'litterbox-order'     => \Wetcat\Litterbox\Middleware\Order::class,
  'litterbox-admin'       => \Wetcat\Litterbox\Middleware\Admin::class,
  'litterbox-superadmin'  => \Wetcat\Litterbox\Middleware\Superadmin::class,
];
  1. Set up CORS app\config\cors.php
return [
  'supportsCredentials' => false,
  'allowedOrigins' => ['*'],
  'allowedHeaders' => ['Content-Type', 'Accept', 'X-Litterbox-Token'],
  'allowedMethods' => ['GET', 'POST', 'PUT',  'DELETE', 'OPTIONS'],
  'exposedHeaders' => [],
  'maxAge' => 0,
  'hosts' => [],  
]
  1. Make sure to disable CSRF tokens in app\Http\Kernel.php
protected $middleware = [
    \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
    \App\Http\Middleware\EncryptCookies::class,
    \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
    \Illuminate\Session\Middleware\StartSession::class,
    \Illuminate\View\Middleware\ShareErrorsFromSession::class,
    //\App\Http\Middleware\VerifyCsrfToken::class,
];