Skip to content

Commit

Permalink
◀️ Add backwards compatibility to 5.7 and 5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
lorisleiva committed Sep 3, 2019
1 parent bb3ea00 commit 45db277
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"require": {
"illuminate/support": "^6.0"
"illuminate/support": "5.7.*|5.8.*|^6.0"
},
"require-dev": {
"mockery/mockery": "^1.0.0",
Expand Down
8 changes: 7 additions & 1 deletion src/Concerns/RunsAsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,18 @@ public function getRequest()

public function getMiddleware()
{
$middleware = [];

if (method_exists($this, 'middleware')) {
$middleware = $this->middleware();
}

return array_map(function ($m) {
return [
'middleware' => $m,
'options' => [],
];
}, $this->middleware());
}, $middleware);
}

public function callAction($method, $parameters)
Expand Down

0 comments on commit 45db277

Please sign in to comment.