Skip to content

Commit

Permalink
Merge branch 'Development'
Browse files Browse the repository at this point in the history
  • Loading branch information
Necko1996 committed Sep 11, 2020
2 parents c87c8db + c4446e1 commit c8e3508
Show file tree
Hide file tree
Showing 39 changed files with 1,149 additions and 666 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
Expand Down
2 changes: 1 addition & 1 deletion .env.travis
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
Expand Down
3 changes: 1 addition & 2 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
// $schedule->command('inspire')->hourly();
}

/**
Expand Down
14 changes: 7 additions & 7 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Exceptions;

use Exception;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Lang;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Throwable;

class Handler extends ExceptionHandler
{
Expand All @@ -32,12 +32,12 @@ class Handler extends ExceptionHandler
/**
* Report or log an exception.
*
* @param \Exception $exception
* @param \Throwable $exception
* @return void
*
* @throws \Exception
* @throws \Throwable
*/
public function report(Exception $exception)
public function report(Throwable $exception)
{
if (app()->bound('sentry') && $this->shouldReport($exception)) {
app('sentry')->captureException($exception);
Expand All @@ -50,12 +50,12 @@ public function report(Exception $exception)
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @param \Throwable $exception
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Exception
* @throws \Throwable
*/
public function render($request, Exception $exception)
public function render($request, Throwable $exception)
{
// Convert all non-http exceptions to a proper 500 http exception
// if we don't do this exceptions are shown as a default template
Expand Down
15 changes: 9 additions & 6 deletions app/Http/Controllers/BoardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
namespace App\Http\Controllers;

use App\Board;
use App\Http\Requests\BoardRequest;
use App\Http\Requests\BoardEditRequest;
use App\Http\Requests\BoardStoreRequest;
use App\Repositories\Board\BoardRepositoryInterface;
use App\Repositories\Team\TeamRepositoryInterface;
use Lang;
Expand Down Expand Up @@ -72,10 +73,10 @@ public function create()
/**
* Store a newly created resource in storage.
*
* @param \App\Http\Requests\BoardRequest $request
* @param \App\Http\Requests\BoardStoreRequest $request
* @return \Illuminate\Http\Response
*/
public function store(BoardRequest $request)
public function store(BoardStoreRequest $request)
{
$this->boardRepository->create(
array_union($request->all(), ['user_id' => auth()->id()])
Expand Down Expand Up @@ -113,13 +114,15 @@ public function edit(Board $board)
/**
* Update the specified resource in storage.
*
* @param \App\Http\Requests\BoardRequest $request
* @param \App\Http\Requests\BoardEditRequest $request
* @param \App\Board $board
* @return \Illuminate\Http\Response
*/
public function update(BoardRequest $request, Board $board)
public function update(BoardEditRequest $request, Board $board)
{
$board->update($request->all());
$board->update([
'name' => $request->name,
]);

session()->flash('success-message', Lang::get('boards.successUpdateBoard'));

Expand Down
19 changes: 2 additions & 17 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ class Kernel extends HttpKernel
* @var array
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\App\Http\Middleware\CheckForMaintenanceMode::class,
\Fruitcake\Cors\HandleCors::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
Expand Down Expand Up @@ -62,21 +64,4 @@ class Kernel extends HttpKernel
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];

/**
* The priority-sorted list of middleware.
*
* This forces non-global middleware to always be in the given order.
*
* @var array
*/
protected $middlewarePriority = [
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\Authenticate::class,
\Illuminate\Routing\Middleware\ThrottleRequests::class,
\Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Illuminate\Auth\Middleware\Authorize::class,
];
}
20 changes: 20 additions & 0 deletions app/Http/Middleware/TrustHosts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Http\Middleware;

use Illuminate\Http\Middleware\TrustHosts as Middleware;

class TrustHosts extends Middleware
{
/**
* Get the host patterns that should be trusted.
*
* @return array
*/
public function hosts()
{
return [
$this->allSubdomainsOfApplicationUrl(),
];
}
}
2 changes: 1 addition & 1 deletion app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class TrustProxies extends Middleware
/**
* The trusted proxies for this application.
*
* @var array|string
* @var array|string|null
*/
protected $proxies;

Expand Down
7 changes: 0 additions & 7 deletions app/Http/Middleware/VerifyCsrfToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@

class VerifyCsrfToken extends Middleware
{
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
*
* @var bool
*/
protected $addHttpCookie = true;

/**
* The URIs that should be excluded from CSRF verification.
*
Expand Down
28 changes: 28 additions & 0 deletions app/Http/Requests/BoardEditRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Http\Requests;

class BoardEditRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return $this->user()->email_verified_at;
}

/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|min:3',
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace App\Http\Requests;

use App\User;

class BoardRequest extends Request
class BoardStoreRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
Expand Down
10 changes: 5 additions & 5 deletions app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public function map()
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}

/**
Expand All @@ -73,8 +73,8 @@ protected function mapWebRoutes()
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
}
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@
"license": "MIT",
"require": {
"php": "^7.3",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.0",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^7.24",
"laravel/tinker": "^2.0",
"laravel/ui": "^1.0",
"laravel/ui": "^2.0",
"sentry/sentry-laravel": "^1.8"
},
"require-dev": {
"facade/ignition": "^1.4",
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"config": {
"optimize-autoloader": true,
Expand Down
Loading

0 comments on commit c8e3508

Please sign in to comment.