Skip to content

Commit

Permalink
Merge branch 'shift-4241'
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot committed Sep 2, 2017
2 parents cedfb39 + cde28f6 commit b8ce617
Show file tree
Hide file tree
Showing 23 changed files with 2,438 additions and 1,980 deletions.
4 changes: 3 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ protected function schedule(Schedule $schedule)
}

/**
* Register the Closure based commands for the application.
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');

require base_path('routes/console.php');
}
}
2 changes: 1 addition & 1 deletion app/Conversations/ExampleConversation.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ public function run()
{
$this->askReason();
}
}
}
36 changes: 12 additions & 24 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@
namespace App\Exceptions;

use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
\Illuminate\Auth\AuthenticationException::class,
\Illuminate\Auth\Access\AuthorizationException::class,
\Symfony\Component\HttpKernel\Exception\HttpException::class,
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
\Illuminate\Session\TokenMismatchException::class,
\Illuminate\Validation\ValidationException::class,
//
];

/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];

/**
Expand All @@ -46,20 +50,4 @@ public function render($request, Exception $exception)
{
return parent::render($request, $exception);
}

/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
* @return \Illuminate\Http\Response
*/
protected function unauthenticated($request, AuthenticationException $exception)
{
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
}

return redirect()->guest(route('login'));
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/BotManController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ public function startConversation(BotMan $bot)
{
$bot->startConversation(new ExampleConversation());
}
}
}
1 change: 1 addition & 0 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Kernel extends HttpKernel
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\App\Http\Middleware\TrustProxies::class,
];

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Middleware/EncryptCookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Http\Middleware;

use Illuminate\Cookie\Middleware\EncryptCookies as BaseEncrypter;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;

class EncryptCookies extends BaseEncrypter
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Middleware/TrimStrings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\TrimStrings as BaseTrimmer;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;

class TrimStrings extends BaseTrimmer
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
Expand Down
29 changes: 29 additions & 0 deletions app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace App\Http\Middleware;

use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;

class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array
*/
protected $proxies;

/**
* The current proxy header mappings.
*
* @var array
*/
protected $headers = [
Request::HEADER_FORWARDED => 'FORWARDED',
Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
];
}
4 changes: 2 additions & 2 deletions app/Http/Middleware/VerifyCsrfToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;

class VerifyCsrfToken extends BaseVerifier
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
Expand Down
3 changes: 1 addition & 2 deletions app/Providers/BotMan/DriverServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ public function boot()
DriverManager::loadDriver($driver);
}
}

}
}
4 changes: 3 additions & 1 deletion artisan
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env php
<?php

define('LARAVEL_START', microtime(true));

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
Expand All @@ -13,7 +15,7 @@
|
*/

require __DIR__.'/bootstrap/autoload.php';
require __DIR__.'/vendor/autoload.php';

$app = require_once __DIR__.'/bootstrap/app.php';

Expand Down
17 changes: 0 additions & 17 deletions bootstrap/autoload.php

This file was deleted.

26 changes: 21 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
{
"name": "botman/studio",
"description": "BotMan Chatbot framework.",
"keywords": ["botman", "chatbot", "framework", "laravel"],
"keywords": [
"botman",
"chatbot",
"framework",
"laravel"
],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0",
"botman/driver-web": "~1.0",
"botman/studio-addons": "~1.0",
"clue/stdio-react": "^1.0",
"laravel/framework": "5.4.*",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0",
"botman/botman": "~2.0",
"botman/tinker": "~1.0",
"mpociot/slack-client": "^0.3.0"
"mpociot/slack-client": "^0.3.0",
"fideloper/proxy": "~3.3"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
"phpunit/phpunit": "~6.0",
"filp/whoops": "~2.0"
},
"autoload": {
"classmap": [
Expand Down Expand Up @@ -49,11 +56,20 @@
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"BotMan\\Studio\\Providers\\DriverServiceProvider::publishDriverConfigurations",
"php artisan optimize"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"extra": {
"laravel": {
"dont-discover": []
}
}
}
}
Loading

0 comments on commit b8ce617

Please sign in to comment.