From a1ddbb15a9c15c12f017d46be839b10591183651 Mon Sep 17 00:00:00 2001 From: Wesley Francisco Date: Mon, 13 Aug 2018 18:03:47 -0300 Subject: [PATCH] Laroute Macro added on Route --- src/LarouteServiceProvider.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/LarouteServiceProvider.php b/src/LarouteServiceProvider.php index 3062dd0..6a3319d 100644 --- a/src/LarouteServiceProvider.php +++ b/src/LarouteServiceProvider.php @@ -2,6 +2,7 @@ namespace Lord\Laroute; +use Illuminate\Routing\Route; use Illuminate\Support\ServiceProvider; use Lord\Laroute\Console\Commands\LarouteGeneratorCommand; use Lord\Laroute\Routes\Collection as Routes; @@ -17,6 +18,12 @@ public function boot() { $source = $this->getConfigPath(); $this->publishes([$source => config_path('laroute.php')], 'config'); + + Route::macro('laroute', function() { + $this->setAction(array_merge($this->getAction(), ['laroute' => true])); + + return $this; + }); } /**