Skip to content

Commit

Permalink
Added macro to get the permalink from the requeest
Browse files Browse the repository at this point in the history
  • Loading branch information
IsraelOrtuno committed Sep 16, 2019
1 parent f0b5f65 commit 9ca13b3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/PermalinkServiceProvider.php
Expand Up @@ -35,6 +35,10 @@ protected function defineMacros()
$this->middlewareGroups = $middlewareGroups;
});

\Illuminate\Http\Request::macro('permalink', function() {
return method_exists($this->route(), 'permalink') ? $this->route()->permalink() : null;
});

Arr::macro('undot', function (array $dotArray) {
$array = [];
foreach ($dotArray as $key => $value) {
Expand Down

0 comments on commit 9ca13b3

Please sign in to comment.