Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit 6ee93fb

Browse files
committed
Creating 'action' config option (for controllers)
The new config option enables us to implement our own validation procedures, without depending on the default closure - this, in turn, enables route caching (./artisan route:cache).
1 parent f1aaf6e commit 6ee93fb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Laravalid/LaravalidServiceProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ public function boot()
2323
], 'config');
2424

2525
$this->publishes([
26-
__DIR__.'/../../public' => public_path('laravalid'),
26+
__DIR__.'/../../public' => public_path('laravalid'),
2727
], 'public');
2828

29-
$routeName = \Config::get('laravalid.route');
30-
3129
// remote validations
32-
\Route::any($routeName.'/{rule}', function($rule){
30+
$routeName = \Config::get('laravalid.route');
31+
$routeAction = \Config::get('laravalid.action', function($rule) {
3332
return $this->app['laravalid']->converter()->route()->convert($rule, \Input::all());
3433
});
3534

35+
\Route::any($routeName.'/{rule}', $routeAction);
3636
}
3737

3838
/**

0 commit comments

Comments
 (0)