Skip to content

Commit

Permalink
Update concerns.
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Feb 27, 2018
1 parent 3532e24 commit 5062af0
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 27 deletions.
31 changes: 31 additions & 0 deletions Concerns/PassThrough.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace Orchestra\Http\Concerns;

trait PassThrough
{
/**
* The application implementation.
*
* @var \Orchestra\Contracts\Foundation\Foundation
*/
protected $foundation;

/**
* Determine if the request has a URI that should pass through CSRF verification.
*
* @param \Illuminate\Http\Request $request
*
* @return bool
*/
protected function shouldPassThrough($request)
{
foreach ($this->except as $except) {
if ($this->foundation->is($except)) {
return true;
}
}

return false;
}
}
2 changes: 1 addition & 1 deletion Traits/Transformable.php → Concerns/Transformable.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Orchestra\Http\Traits;
namespace Orchestra\Http\Concerns;

use Orchestra\Support\Arr;
use Orchestra\Support\Str;
Expand Down
1 change: 0 additions & 1 deletion Middleware/RequireCsrfToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

class RequireCsrfToken
{

/**
* The application instance.
*
Expand Down
30 changes: 6 additions & 24 deletions Traits/PassThrough.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,12 @@

namespace Orchestra\Http\Traits;

use Orchestra\Http\Concerns\PassThrough as Concern;

/**
* @deprecated v3.6.0
*/
trait PassThrough
{
/**
* The application implementation.
*
* @var \Orchestra\Contracts\Foundation\Foundation
*/
protected $foundation;

/**
* Determine if the request has a URI that should pass through CSRF verification.
*
* @param \Illuminate\Http\Request $request
*
* @return bool
*/
protected function shouldPassThrough($request)
{
foreach ($this->except as $except) {
if ($this->foundation->is($except)) {
return true;
}
}

return false;
}
use Concern;
}
2 changes: 1 addition & 1 deletion Transformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

abstract class Transformer extends BaseTransformer
{
use Traits\Transformable;
use Concerns\Transformable;

/**
* Invoke the transformation.
Expand Down

0 comments on commit 5062af0

Please sign in to comment.