controller() public static method

Route a controller to a URI with wildcard routing.
Deprecation: since version 5.2.
public static controller ( string $uri, string $controller, array $names = [] ) : void
$uri string
$controller string
$names array
return void
示例#1
0
 public static function setRoutes($routes)
 {
     foreach ($routes as $c) {
         if (class_exists($c->action)) {
             if ($c->route_name == '/') {
                 $routable = \Route::getInspector()->getRoutable($c->action, '');
             } else {
                 $routable = \Route::getInspector()->getRoutable($c->action, $c->route_name);
             }
             foreach ($routable as $k => $v) {
                 if ($v[0]['verb'] == 'get') {
                     if (isset($v[1])) {
                         if ($v[1]['plain'] == '') {
                             \Route::get('/', ['as' => '/', 'uses' => $c->action . '@' . $k]);
                         } else {
                             \Route::get($v[1]['plain'], ['as' => $v[1]['plain'], 'uses' => $c->action . '@' . $k]);
                         }
                         continue;
                     }
                     \Route::get($v[0]['plain'], ['as' => $v[0]['plain'], 'uses' => $c->action . '@' . $k]);
                 } elseif ($v[0]['verb'] == 'post') {
                     if (preg_match('/[\\s\\S]+\\/index/', $v[0]['plain'])) {
                         $v[0]['plain'] = str_replace('/index', '', $v[0]['plain']);
                     }
                     \Route::post($v[0]['plain'], ['as' => $v[0]['plain'], 'uses' => $c->action . '@' . $k]);
                 }
             }
             if ($c->other_route != '') {
                 \Route::controller($c->other_route, $c->action);
             }
         }
     }
 }
 public static function returnRoutes($prefix = null)
 {
     $class = __CLASS__;
     Route::post('admin/gallery/ajax-order-save', array('as' => 'gallery.order', 'uses' => $class . "@postAjaxOrderSave"));
     Route::group(array('before' => 'auth', 'prefix' => $prefix), function () use($class) {
         Route::get($class::$group . '/manage', array('uses' => $class . '@getIndex'));
         Route::controller($class::$group, $class);
     });
 }
 public static function returnRoutes($prefix = null)
 {
     $class = __CLASS__;
     $name = self::$name;
     $group = self::$group;
     Route::group(array('before' => 'auth', 'prefix' => 'admin'), function () use($class, $name, $group) {
         Route::controller($group . '/' . $name, $class);
     });
 }
示例#4
0
 public function routes()
 {
     R::group(['namespace' => 'Controllers'], function () {
         R::controller('thanks/{ref}', 'Thanks');
         R::controller('webhooks', 'Webhooks');
         R::controller('other', 'Other');
         R::controller('/', 'Root');
     });
 }
示例#5
0
文件: Route.php 项目: phumaster/fw
 private static function setMethod($need = null)
 {
     if (is_null($need)) {
         return;
     }
     $method = trim($need, '/');
     $arr = explode('@', $method);
     self::$method = $arr[1];
     self::$controller = $arr[0];
 }
示例#6
0
/**
 * Quickly define a new route.
 * A new Route can be defined in two ways:
 *
 * either by passing all of the route parameters as parameters to R():
 *   R('','TestController','index','GET');
 *
 * or by using the methods of the Route class:
 *   R('')->controller("TestController")->action("index")->on("GET");
 *
 * (thanks to:  Rafael S. Souza <rafael.ssouza [__at__] gmail.com>)
 */
function R($pattern)
{
    if (count($args = func_get_args()) == 4) {
        $r = new Route($args[0]);
        $r->controller($args[1])->action($args[2])->on($args[3]);
        return $r;
    } else {
        return new Route($pattern);
    }
}
示例#7
0
 public function handle(Route $route)
 {
     $factory = $this->factory($route->controller());
     $controller = $factory->invoke();
     $controller->context = $this->httpContext;
     $view = $this->view($controller, $this->action($route->action()), $route->parameters());
     $view->context = $this->httpContext;
     $this->header($view);
     $this->render($view);
 }
 public static function returnRoutes($prefix = null)
 {
     $class = __CLASS__;
     $name = self::$name;
     $group = self::$group;
     Route::group(array('before' => 'auth', 'prefix' => 'admin'), function () use($class, $name, $group) {
         Route::post($group . '/' . $name, array('as' => 'modules.change', 'uses' => $class . '@postModule'));
         Route::post($name . '/ajax-order-save', array('as' => 'modules.order', 'uses' => $class . "@postAjaxOrderSave"));
         Route::controller($group . '/' . $name, $class);
     });
 }
 public static function returnRoutes($prefix = null)
 {
     $class = __CLASS__;
     $name = self::$name;
     $group = self::$group;
     Route::group(array('before' => 'auth', 'prefix' => 'admin'), function () use($class, $name, $group) {
         Route::get($group . '/' . $name . '/edit/{mod}', $class . '@getEdit');
         Route::get($group . '/' . $name . '/save/{mod}', $class . '@postSave');
         Route::controller($group . '/' . $name, $class);
     });
     ModTemplates::addTplDir();
     ## Site layout dir
 }
示例#10
0
/**
 * Quickly define a new route.
 * A new Route can be defined in two ways:
 *  @package NimblePack
 * either by passing all of the route parameters as parameters to R():
 *   R('','TestController','index','GET');
 *
 * or by using the methods of the Route class:
 *   R('')->controller("TestController")->action("index")->on("GET")->short_url('test_index');
 *
 * (thanks to:  Rafael S. Souza <rafael.ssouza [__at__] gmail.com>)
 */
function R()
{
    $args = func_get_args();
    switch (count($args)) {
        case 0:
        case 2:
        case 3:
            throw new NimbleException("Incorrect number of parameters for R()");
        case 1:
            return new Route($args[0]);
        case 4:
            $r = new Route($args[0]);
            $r->controller($args[1])->action($args[2])->on($args[3]);
            return $r;
        case 5:
            $r = new Route($args[0]);
            $r->controller($args[1])->action($args[2])->on($args[3])->short_url($args[4]);
            return $r;
    }
}
示例#11
0
<?php

/*
|----------------------------------------------
| App Routes
|----------------------------------------------
*/
Route::controller("welcom", "welcoms");
示例#12
0
<?php

Route::group(['prefix' => 'search', 'namespace' => 'Modules\\Search\\Http\\Controllers'], function () {
    //Route::get('/', 'SearchController@index');
    Route::controller('/', 'SearchController');
});
示例#13
0
<?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 controller to call when that URI is requested.
|
*/
// Création des routes pour le contrôleur implicite SondageController
Route::controller('sondage', 'SondageController');
Route::get('/', function () {
    return view('welcome');
});
示例#14
0
<?php

Route::group(['namespace' => '\\CMS', 'prefix' => 'cms'], function () {
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    // LOGIN
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    get('/', ['uses' => 'LoginController@show', 'as' => 'cms.login']);
    post('/', ['uses' => 'LoginController@postLogin', 'as' => 'cms.login.post']);
    get('/logout', ['uses' => 'LoginController@logout', 'as' => 'cms.logout']);
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    // DASHBOARD
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    get('/', ['uses' => 'MenuController@index', 'as' => 'cms.menu']);
    Route::group(['prefix' => 'dashboard'], function () {
        get('/', ['uses' => 'DashboardController@index', 'as' => 'cms.dashboard']);
    });
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    // NEWS
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    Route::controller('news', 'NewsController', ['getIndex' => 'cms.news', 'getCreate' => 'cms.news.create', 'postStore' => 'cms.news.store', 'getEdit' => 'cms.news.edit', 'getUpdate' => 'cms.news.update', 'getShow' => 'cms.news.show', 'putDelete' => 'cms.news.delete']);
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    // SETTINGS
    // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
    Route::group(['prefix' => 'settings'], function () {
        // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
        // WEBSITE
        // ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
        Route::controller('website', 'WebsiteController', ['getIndex' => 'cms.website', 'getCreate' => 'cms.website.create', 'postStore' => 'cms.website.store', 'getEdit' => 'cms.website.edit', 'getUpdate' => 'cms.website.update', 'getShow' => 'cms.website.show', 'putDelete' => 'cms.website.delete']);
    });
});
示例#15
0
<?php

Route::controller('confirmation', '\\Aamant\\EmailConfirmation\\ConfirmationController');
示例#16
0
文件: routes.php 项目: ahuggins/taskr
<?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 controller to call when that URI is requested.
|
*/
Route::get('/', 'PagesController@home');
Route::resource('list', 'ListController');
Route::get('sign-up', function () {
    return view('app.content.signup');
});
Route::get('sign-in', 'UserController@login');
Route::post('login', 'UserController@attempt');
Route::post('sign-up', 'UserController@create');
Route::get('logout', 'UserController@logout');
Route::resource('teams', 'TeamController');
Route::controller('api', 'TaskController');
示例#17
0
    Route::get('user/withdraw', 'TransactionsController@withdraw');
    Route::post('user/withdraw', 'TransactionsController@withdrawRequest');
    Route::get('user/addmoney', 'TransactionsController@addMoneyPage');
    Route::post('user/transactions/addmoney', 'TransactionsController@addMoneyToAccount');
    Route::get('user/transactions/cashout', function () {
        return View::make('backend.user.cashout');
    });
    Route::post('user/transactions/cashout', 'TransactionsController@cashOutRequest');
    Route::get('user/admin/transaction/commentary', 'TransactionsController@transactionComment');
    Route::post('user/edit/coords', 'UserController@updateCoords');
});
Route::get('user/confirm/{cc}', 'UserController@confirm');
Route::get('language/{lang}', 'LanguageController@index');
Route::resource('session', 'SessionsController');
Route::resource('user', 'SessionsController');
Route::controller('password', 'RemindersController');
View::creator('layouts.backend.base', function ($view) {
    if (Auth::user()->role == '1') {
        $users = User::where('role', '=', '2')->get();
        $usersRegistered = count($users);
        $currentAmmount = 0;
        $totalAdded = 0;
        $totalInvested = 0;
        $totalRewarded = 0;
        $totalWithdrawn = 0;
        $totalCycles = 0;
        foreach ($users as $user) {
            if ($user->awaiting_award == 1) {
                $lastInvestedAmmount = Transaction::where('user_id', '=', $user->id)->where('transaction_direction', '=', 'invested')->where('confirmed', '=', 1)->orderBy('created_at', 'DESC')->first();
                if (count($lastInvestedAmmount) == 0) {
                    $lastInvestedAmmount = 0;
示例#18
0
Route::get('/classes', function () {
    return view('group');
})->middleware(['web', 'auth']);
Route::get('/test', function () {
    return view('test');
})->middleware(['web', 'auth']);
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function () {
    Route::controller('account', 'UsersUtilityController');
});
Route::group(['middleware' => ['web'], 'prefix' => 'api/v1', 'namespace' => 'API\\V1'], function () {
    Route::resource('account', 'AccountCreateController', ['only' => ['index', 'store']]);
    Route::resource('account/login', 'AccountLoginController', ['only' => ['store', 'destroy']]);
});
Route::group(['middleware' => ['web', 'auth'], 'prefix' => 'api/v2', 'namespace' => 'V2'], function () {
    Route::resource('files', 'FileController', ['only' => ['index', 'store']]);
    Route::resource('groups', 'GroupController', ['only' => ['index', 'store']]);
    Route::resource('groups.files.comments', 'GroupFileCommentController', ['only' => ['index', 'store']]);
    Route::resource('groups.files', 'GroupsFilesController', ['only' => ['index', 'store']]);
    Route::resource('groups.assignments', 'GroupAssignmentController', ['only' => ['index', 'store']]);
    //Change
});
示例#19
0
| 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 controller to call when that URI is requested.
|
*/
//Route::get('/', function () {
//    return view('welcome');
//});
Route::get('/index', ['as' => 'index', function () {
    return view('index');
}]);
Route::get('/', function () {
    return view('index');
});
Route::get('/company', ['as' => 'company', function () {
    return view('company');
}]);
Route::get('/support', ['as' => 'support', function () {
    return view('support');
}]);
Route::controller('auth', 'UsersController');
Route::resource('test', 'TestController');
Route::get('/bootstrap', function () {
    return view('bootstrap');
});
Route::get('/image', function () {
    return view('image');
});
示例#20
0
<?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 controller to call when that URI is requested.
|
*/
Route::controller('auth', 'Auth\\AuthController', ['getConfirm' => 'auth.confirm', 'getResendConfirm' => 'auth.confirm.resend']);
Route::controller('password', 'Auth\\PasswordController');
Route::get('/status/{referral_secret?}', ['as' => 'user.status', 'uses' => 'UsersController@status']);
Route::get('/privacy', ['as' => 'privacy', function () {
    return view('static.privacy');
}]);
Route::get('/', ['as' => 'user.create', 'middleware' => 'status-page', 'uses' => 'UsersController@create']);
Route::get('/homepage', ['as' => 'user.create.nostatus', 'uses' => 'UsersController@create']);
Route::post('/', ['as' => 'user.store', 'uses' => 'UsersController@store']);
Route::get('/{referrer_code}', ['as' => 'user.referral', 'uses' => 'UsersController@referral']);
示例#21
0
<?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 controller to call when that URI is requested.
|
*/
// Authentication routes...
Route::get('/login', array('as' => 'login', 'uses' => 'Auth\\AuthController@getLogin'));
Route::post('/login', array('as' => 'login', 'uses' => 'Auth\\AuthController@postLogin'));
Route::get('/logout', array('as' => 'logout', 'uses' => 'Auth\\AuthController@getLogout'));
Route::get('/', array('as' => 'login', 'uses' => function () {
    return redirect('login');
}));
//admin
Route::get('admin', 'AdminController@index');
//categoria
Route::controller('admin/categoria', 'CategoriaController');
示例#22
0
    Route::get('services/settings', ['as' => 'admin.services.settings', 'uses' => 'Admin\\ServicesController@getSettings']);
    Route::post('services/settings', 'Admin\\ServicesController@postSettings');
    /* Ranking */
    Route::get('ranking/settings', ['as' => 'admin.ranking.settings', 'uses' => 'Admin\\RankingController@getSettings']);
    Route::post('ranking/settings', 'Admin\\RankingController@postSettings');
    /* Management */
    Route::get('management/gm', ['as' => 'admin.management.gm.view', 'uses' => 'Admin\\ManagementController@getGM']);
    Route::post('management/gm', 'Admin\\ManagementController@postGM');
    Route::get('management/gm/edit/{user}', ['as' => 'admin.management.gm.edit', 'uses' => 'Admin\\ManagementController@getGMEdit']);
    Route::post('management/gm/edit/{user}', 'Admin\\ManagementController@postGMEdit');
    Route::get('management/gm/remove/{user}', 'Admin\\ManagementController@getGMRemove');
    Route::get('management/chat/watch', ['as' => 'admin.management.chat.watch', 'uses' => 'Admin\\ManagementController@getChatWatch']);
    Route::post('management/chat/logs', 'Admin\\ManagementController@postChatLogs');
    Route::get('management/chat/settings', ['as' => 'admin.management.chat.settings', 'uses' => 'Admin\\ManagementController@getChatSettings']);
    Route::post('management/chat/settings', 'Admin\\ManagementController@postChatSettings');
    Route::controller('management', 'Admin\\ManagementController', ['getBroadcast' => 'admin.management.broadcast', 'getMailer' => 'admin.management.mailer', 'getForbid' => 'admin.management.forbid']);
});
/* Installer */
Route::group(['prefix' => 'admin/install', 'as' => 'admin.installer.'], function () {
    Route::group(['middleware' => 'installed'], function () {
        get('/', ['as' => 'welcome', 'uses' => 'Admin\\InstallController@welcome']);
        get('settings', ['as' => 'settings', 'uses' => 'Admin\\InstallController@getSettings']);
        post('setup', ['as' => 'settings.save', 'uses' => 'Admin\\InstallController@postSettings']);
        /*get( 'environment', [
                    'as' => 'environment',
                    'uses' => 'Admin\InstallController@environment'
                ]);
        
                post( 'environment/save', [
                    'as' => 'environment.save',
                    'uses' => 'Admin\InstallController@save'
示例#23
0
});
Route::get('/app/nelayan', function () {
    return view('app.nelayan.index');
});
Route::get('/app/pengolah', function () {
    return view('app.pengolah.index');
});
Route::get('/app/master/bantuan', function () {
    return view('app.master.bantuan');
});
Route::get('/app/master/jabatan', function () {
    return view('app.master.jabatan');
});
Route::get('/app/master/jenis-usaha', function () {
    return view('app.master.jenis-usaha');
});
Route::get('/app/master/sarana-pembudidaya', function () {
    return view('app.master.sarana-pembudidaya');
});
Route::get('/app/pengaturan', function () {
    return view('app.pengaturan.index');
});
Route::get('/app/login', function () {
    return view('app.login.index');
});
// App
Route::group(['namespace' => 'App'], function () {
    Route::controller('app/master/bantuan', 'BantuanController', ['getIndex' => 'bantuan', 'getTambah' => 'bantuan_tambah', 'getHapus' => 'bantuan_hapus']);
    Route::controller('app/master/jabatan', 'JabatanController', ['getIndex' => 'jabatan', 'getTambah' => 'jabatan_tambah', 'getHapus' => 'jabatan_hapus']);
    Route::controller('app/master/usaha', 'UsahaController', ['getIndex' => 'usaha', 'getTambah' => 'usaha_tambah']);
});
示例#24
0
| 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.
|
*/
//Route::post('delete-additional-designer', array('as' =>'delete-additional-designer' , 'before' => 'auth', 'uses' => 'HomeController@deleteAdditionalDesigner' ));
Route::get('/', 'UsersController@homeCreate');
Route::get('/users/delete-gallery-image/', 'UsersController@deleteUserImage');
Route::get('/users/edit-profile-value/', 'UsersController@editProfile');
// Route::get('/users/edit-profile/', 'UsersController@editProfile');
Route::get('/users/edit-active-value/', 'UsersController@changeActive');
/*Route::post('/users/dashboard/{id}', function($id)
{
	return $id;
});*/
Route::post('/users/dashboard', 'UsersController@createPhoto');
Route::get('/users/dashboard', 'UsersController@getDashboard');
Route::get('/users/profile', 'UsersController@profilePage');
Route::get('/users', 'UsersController@homeCreate');
Route::controller('/users', 'UsersController');
// Route::get('/signin', function()
// {
// 	return View::make('signin');
// });
// Route::get('/user', function()
// {
// 	return "hello user";
// });
// Route::get('/user', 'UserController@showProfile');
// Route::get('/welcome', 'UserController@welcome');
// Route::get('/wel/{id}', 'UserController@signup');
// Route::get('/dashboard', 'UserController@signin');
示例#25
0
/************************************************************/
// These would conflict with controller routes, so they need to be set before them
Route::get('event/{id_slug}', 'EventController@getDetails');
/************************************************************/
/* ******************** GENERIC ROUTES ******************** */
/************************************************************/
Route::controller('auth', 'AuthController');
Route::controller('user', 'UserController');
Route::controller('event', 'EventController');
Route::controller('theme', 'ThemeController');
Route::controller('autocomplete', 'AutoCompleteController');
/************************************************************/
/* ****************** ADDITIONAL ROUTES ******************* */
/************************************************************/
Route::get('user/{id_slug}', 'UserController@getProfile');
Route::get('speaker/{id_slug}', 'UserController@getSpeaker');
Route::get('event/search', 'EventController@getSearch');
/** @link https://github.com/laravel/framework/issues/10659 */
/************************************************************/
/* ************** CATCH-ALL / MAIN ROUTES ***************** */
/************************************************************/
if (getenv('APP_ENV') !== 'prod') {
    //imported from vendor/barryvdh/laravel-debugbar/src/ServiceProvider.php:72
    //TODO: without re-declaring those here, the SiteController catch-all would get precedence
    Route::get('_debugbar/open', ['uses' => 'OpenHandlerController@handle', 'as' => 'debugbar.openhandler']);
    Route::get('_debugbar/clockwork/{id}', ['uses' => 'OpenHandlerController@clockwork', 'as' => 'debugbar.clockwork']);
    Route::get('_debugbar/assets/stylesheets', ['uses' => 'AssetController@css', 'as' => 'debugbar.assets.css']);
    Route::get('_debugbar/assets/javascript', ['uses' => 'AssetController@js', 'as' => 'debugbar.assets.js']);
}
Route::controller('/', 'SiteController');
示例#26
0
Route::get('/terms-and-conditions', ['as' => 'terms_path', 'uses' => 'PagesController@terms']);
Route::get('/privacy-policy', ['as' => 'privacy_path', 'uses' => 'PagesController@privacy']);
// Registration
Route::get('register', ['as' => 'register_path', 'uses' => 'RegistrationController@create', 'middleware' => 'guest']);
Route::post('register', ['as' => 'register_path', 'uses' => 'RegistrationController@store', 'middleware' => 'guest']);
Route::get('/unverified', ['as' => 'unverified_path', 'uses' => 'RegistrationController@unverified', 'middleware' => 'auth']);
Route::post('/verify/send', ['as' => 'send_verification_path', 'uses' => 'RegistrationController@sendVerification', 'middleware' => 'auth']);
Route::get('/verify/{verificationCode}', ['as' => 'verification_path', 'uses' => 'RegistrationController@verify']);
// Oauth
Route::get('oauth/{provider}/redirect', ['as' => 'oauth_redirect_path', 'uses' => 'Oauth\\RegistrationAndLoginController@redirectToProvider']);
Route::get('oauth/{provider}/callback', ['as' => 'oauth_callback_path', 'uses' => 'Oauth\\RegistrationAndLoginController@handleProviderCallback']);
// Sessions
Route::get('login', ['as' => 'login_path', 'uses' => 'SessionsController@create', 'middleware' => 'guest']);
Route::post('login', ['as' => 'login_path', 'uses' => 'SessionsController@store', 'middleware' => 'guest']);
Route::get('logout', ['as' => 'logout_path', 'uses' => 'SessionsController@destroy']);
Route::controller('password', 'PasswordController');
// User
Route::get('account', ['as' => 'edit_user_path', 'uses' => 'UsersController@edit', 'middleware' => 'auth']);
Route::post('account', ['as' => 'edit_user_path', 'uses' => 'UsersController@update', 'middleware' => 'auth']);
Route::delete('account', ['as' => 'destroy_user_path', 'uses' => 'UsersController@destroy', 'middleware' => 'auth']);
// Droplets
Route::get('droplets', ['as' => 'droplets_path', 'uses' => 'DropletsController@index', 'middleware' => 'auth']);
Route::get('droplet/create', ['as' => 'create_droplet_path', 'uses' => 'DropletsController@create', 'middleware' => 'auth']);
Route::get('d/{slug}', ['as' => 'droplet_path', 'uses' => 'DropletsController@show']);
Route::post('d/{slug}', ['as' => 'droplet_path', 'uses' => 'DropletsController@handleAuth']);
Route::get('droplet/new/{uploadHash}', ['as' => 'droplet_created_path', 'uses' => 'DropletsController@created']);
Route::get('droplet/{dropletId}', ['as' => 'droplet_files_path', 'uses' => 'DropletsController@files']);
Route::delete('droplet/{dropletId}', ['as' => 'destroy_droplet_path', 'uses' => 'DropletsController@destroy']);
Route::get('droplet/{dropletId}/edit', ['as' => 'edit_droplet_path', 'uses' => 'DropletsController@edit']);
Route::post('droplet/{dropletId}/edit', ['as' => 'edit_droplet_path', 'uses' => 'DropletsController@update']);
Route::get('droplet/{dropletId}/security', ['as' => 'droplet_security_path', 'uses' => 'DropletsController@security']);
示例#27
0
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
    return view('welcome');
});
use Illuminate\Support\Facades\App;
get('/bridge', function () {
    $pusher = App::make('pusher');
    $pusher->trigger('test-channel', 'test-event', array('text' => 'all your base are belong to us - bridge'));
    return view('welcome');
});
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class TestEvent implements ShouldBroadcast
{
    public $text;
    public function __construct($text)
    {
        $this->text = $text;
    }
    public function broadcastOn()
    {
        return ['test-channel'];
    }
}
get('/broadcast', function () {
    event(new TestEvent('all your base are belong to us - broadcast'));
    return view('welcome');
});
Route::controller('notifications', 'NotificationController');
示例#28
0
<?php

Route::controller('lari18n', 'Nicolasbeauvais\\Lari18n\\Lari18nController');
示例#29
0
文件: routes.php 项目: e-gob/api-dpa
| You can even respond to more than one URI:
|
|		Route::post(array('hello', 'world'), function()
|		{
|			return 'Hello World!';
|		});
|
| It's easy to allow URI wildcards using (:num) or (:any):
|
|		Route::put('hello/(:any)', function($name)
|		{
|			return "Welcome, $name.";
|		});
|
*/
Route::controller('home');
// Regiones
Route::any('regiones', array('as' => 'regiones', 'uses' => 'api.regiones@regiones'));
Route::any('regiones/(:num)', array('as' => 'region', 'uses' => 'api.regiones@region'));
// Provincias
Route::any('provincias', array('as' => 'provincias', 'uses' => 'api.provincias@provincias'));
Route::any('provincias/(:num)', array('as' => 'provincia', 'uses' => 'api.provincias@provincia'));
// Comunas
Route::any('comunas', array('as' => 'comunas', 'uses' => 'api.comunas@comunas'));
Route::any('comunas/(:num)', array('as' => 'comuna', 'uses' => 'api.comunas@comuna'));
// Provincias por Región
Route::any('regiones/(:num)/provincias', array('as' => 'region_provincias', 'uses' => 'api.provincias@region_provincias'));
Route::any('regiones/(:num)/provincias/(:num)', array('as' => 'region_provincia', 'uses' => 'api.provincias@region_provincia'));
// Comunas por Región
Route::any('regiones/(:num)/comunas', array('as' => 'region_comunas', 'uses' => 'api.comunas@region_comunas'));
Route::any('regiones/(:num)/comunas/(:num)', array('as' => 'region_comuna', 'uses' => 'api.comunas@region_comuna'));
示例#30
0
<?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 controller to call when that URI is requested.
|
*/
Route::get('/', function () {
    return view('welcome');
});
Route::controller('jobs', 'JobsController');