-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.php
55 lines (43 loc) · 1.37 KB
/
routes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
$config = Config::get('jquery-uploader::jquery-uploader');
/*
Route::get('some-route', function()
{
$config = Config::get('some.config');
Route::dispatch( MyController($config) );
return new MyController(configData);
});
*/
foreach ($config as $name => $attribs)
{
$index = array(
'uses' => $attribs['controller'] . '@index',
'as' => $name . '-index',
);
$run = array(
'uses' => $attribs['controller'] . '@run',
'as' => $name . '-run',
);
$view = array(
'uses' => $attribs['controller'] . '@view',
'as' => $name . '-view',
);
if ($attribs['before']) {
$index['before'] = $attribs['before'];
$run['before'] = $attribs['before'];
$view['before'] = $attribs['before'];
}
Route::get($attribs['index'], $index);
Route::any($attribs['index'] . '-run', $run);
Route::get($attribs['index'] . '-view/{version}/{filename}', $view);
}