mirror of
https://github.com/flarum/framework.git
synced 2024-12-04 08:13:39 +08:00
6898e0acbb
- 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.
35 lines
942 B
PHP
Executable File
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')
|
|
]);
|