framework/src/Forum/routes.php
Toby Zerner 6898e0acbb Refactor Flarum\Web and Flarum\Admin
- In order to be consistent with the Ember/LESS naming scheme, renamed
Flarum\Web to Flarum\Forum.
- Moved common classes into Flarum\Support so that Flarum\Admin doesn’t
depend on Flarum\Forum. Also moved Actor into Flarum\Support as it
doesn’t belong in the domain.
2015-03-30 16:17:04 +10:30

35 lines
942 B
PHP
Executable File

<?php
$action = function ($class) {
return function () use ($class) {
$action = $this->app->make($class);
$request = $this->app['request']->instance();
$parameters = $this->app['router']->current()->parameters();
return $action->handle($request, $parameters);
};
};
Route::group(['middleware' => 'Flarum\Forum\Middleware\LoginWithCookie'], function () use ($action) {
Route::get('/', [
'as' => 'flarum.forum.index',
'uses' => $action('Flarum\Forum\Actions\IndexAction')
]);
Route::get('logout', [
'as' => 'flarum.forum.logout',
'uses' => $action('Flarum\Forum\Actions\LogoutAction')
]);
});
Route::post('login', [
'as' => 'flarum.forum.login',
'uses' => $action('Flarum\Forum\Actions\LoginAction')
]);
Route::get('confirm/{id}/{token}', [
'as' => 'flarum.forum.confirm',
'uses' => $action('Flarum\Forum\Actions\ConfirmAction')
]);