Skip to content

Commit

Permalink
Add PassThrough trait.
Browse files Browse the repository at this point in the history
Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Mar 18, 2016
1 parent 46fbe11 commit 86c1f1d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 24 deletions.
29 changes: 29 additions & 0 deletions Traits/PassThrough.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php namespace Orchestra\Http\Traits;

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;
}
}
28 changes: 4 additions & 24 deletions Traits/PassThroughTrait.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
<?php namespace Orchestra\Http\Traits;

/**
* @deprecated v3.2.x
*/
trait PassThroughTrait
{
/**
* 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 PassThrough;
}

0 comments on commit 86c1f1d

Please sign in to comment.