wetcat / litterbox-api
The Litterbox backend.
dev-master
2016-04-10 17:36 UTC
Requires
- anlutro/l4-settings: ^0.4.4
- barryvdh/laravel-cors: ^0.8.0
- cornford/googlitics: 2.*
- intervention/image: ^2.3
- ramsey/uuid: ^3.0
- vinelab/neoeloquent: ^1.2
Requires (Dev)
- phpunit/phpunit: 4.0.*
This package is auto-updated.
Last update: 2024-11-27 08:57:44 UTC
README
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)
-
Install package with
composer require wetcat/litterbox-api dev-master
-
Add provider
Wetcat\Litterbox\LitterboxServiceProvider::class,
-
Publish config
php artisan vendor:publish
and modify to suit your Neo server. -
Update configs.
-
Add datbase settings
'default' => 'neo4j',
'connections' => [ 'neo4j' => [ 'driver' => 'neo4j', 'host' => 'localhost', 'port' => '7474', 'username' => null, 'password' => null ] ]
- 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, ];
- 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' => [], ]
- 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, ];