post() public méthode

public post ( $path, $name, $handler )
 /**
  * @return RouteCollection
  */
 protected function getRoutes()
 {
     $routes = new RouteCollection();
     $toController = $this->getHandlerGenerator($this->app);
     $routes->get('/', 'index', $toController('Flarum\\Update\\Controller\\IndexController'));
     $routes->post('/', 'update', $toController('Flarum\\Update\\Controller\\UpdateController'));
     return $routes;
 }
Exemple #2
0
 protected function routes()
 {
     $this->app->instance('flarum.forum.routes', $routes = new RouteCollection());
     $routes->get('/all', 'flarum.forum.index', $this->action('Flarum\\Forum\\Actions\\IndexAction'));
     $routes->get('/d/{id:\\d+(?:-[^/]*)?}[/{near}]', 'flarum.forum.discussion', $this->action('Flarum\\Forum\\Actions\\DiscussionAction'));
     $routes->get('/u/{username}[/{filter}]', 'flarum.forum.user', $this->action('Flarum\\Forum\\Actions\\ClientAction'));
     $routes->get('/settings', 'flarum.forum.settings', $this->action('Flarum\\Forum\\Actions\\ClientAction'));
     $routes->get('/notifications', 'flarum.forum.notifications', $this->action('Flarum\\Forum\\Actions\\ClientAction'));
     $routes->get('/logout', 'flarum.forum.logout', $this->action('Flarum\\Forum\\Actions\\LogoutAction'));
     $routes->post('/login', 'flarum.forum.login', $this->action('Flarum\\Forum\\Actions\\LoginAction'));
     $routes->get('/confirm/{token}', 'flarum.forum.confirmEmail', $this->action('Flarum\\Forum\\Actions\\ConfirmEmailAction'));
     $routes->get('/reset/{token}', 'flarum.forum.resetPassword', $this->action('Flarum\\Forum\\Actions\\ResetPasswordAction'));
     $routes->post('/reset', 'flarum.forum.savePassword', $this->action('Flarum\\Forum\\Actions\\SavePasswordAction'));
     event(new RegisterForumRoutes($routes));
     $settings = $this->app->make('Flarum\\Core\\Settings\\SettingsRepository');
     $routes->get('/', 'flarum.forum.default', $routes->getRouteData()[0]['GET'][$settings->get('default_route')]);
 }
Exemple #3
0
 /**
  * Populate the forum client routes.
  *
  * @param RouteCollection $routes
  */
 protected function populateRoutes(RouteCollection $routes)
 {
     $route = $this->app->make(RouteHandlerFactory::class);
     $routes->get('/all', 'index', $toDefaultController = $route->toController(Controller\IndexController::class));
     $routes->get('/d/{id:\\d+(?:-[^/]*)?}[/{near:[^/]*}]', 'discussion', $route->toController(Controller\DiscussionController::class));
     $routes->get('/u/{username}[/{filter:[^/]*}]', 'user', $route->toController(Controller\WebAppController::class));
     $routes->get('/settings', 'settings', $route->toController(Controller\AuthorizedWebAppController::class));
     $routes->get('/notifications', 'notifications', $route->toController(Controller\AuthorizedWebAppController::class));
     $routes->get('/logout', 'logout', $route->toController(Controller\LogOutController::class));
     $routes->post('/login', 'login', $route->toController(Controller\LogInController::class));
     $routes->post('/register', 'register', $route->toController(Controller\RegisterController::class));
     $routes->get('/confirm/{token}', 'confirmEmail', $route->toController(Controller\ConfirmEmailController::class));
     $routes->get('/reset/{token}', 'resetPassword', $route->toController(Controller\ResetPasswordController::class));
     $routes->post('/reset', 'savePassword', $route->toController(Controller\SavePasswordController::class));
     $this->app->make('events')->fire(new ConfigureForumRoutes($routes, $route));
     $defaultRoute = $this->app->make('flarum.settings')->get('default_route');
     if (isset($routes->getRouteData()[0]['GET'][$defaultRoute])) {
         $toDefaultController = $routes->getRouteData()[0]['GET'][$defaultRoute];
     }
     $routes->get('/', 'default', $toDefaultController);
 }
 /**
  * Get the forum client routes.
  *
  * @return RouteCollection
  */
 protected function getRoutes()
 {
     $routes = new RouteCollection();
     $toController = $this->getHandlerGenerator($this->app);
     $routes->get('/all', 'index', $toDefaultController = $toController('Flarum\\Forum\\Controller\\IndexController'));
     $routes->get('/d/{id:\\d+(?:-[^/]*)?}[/{near:[^/]*}]', 'discussion', $toController('Flarum\\Forum\\Controller\\DiscussionController'));
     $routes->get('/u/{username}[/{filter:[^/]*}]', 'user', $toController('Flarum\\Forum\\Controller\\ClientController'));
     $routes->get('/settings', 'settings', $toController('Flarum\\Forum\\Controller\\ClientController'));
     $routes->get('/notifications', 'notifications', $toController('Flarum\\Forum\\Controller\\ClientController'));
     $routes->get('/logout', 'logout', $toController('Flarum\\Forum\\Controller\\LogOutController'));
     $routes->post('/login', 'login', $toController('Flarum\\Forum\\Controller\\LogInController'));
     $routes->post('/register', 'register', $toController('Flarum\\Forum\\Controller\\RegisterController'));
     $routes->get('/confirm/{token}', 'confirmEmail', $toController('Flarum\\Forum\\Controller\\ConfirmEmailController'));
     $routes->get('/reset/{token}', 'resetPassword', $toController('Flarum\\Forum\\Controller\\ResetPasswordController'));
     $routes->post('/reset', 'savePassword', $toController('Flarum\\Forum\\Controller\\SavePasswordController'));
     $this->app->make('events')->fire(new ConfigureForumRoutes($routes, $toController));
     $defaultRoute = $this->app->make('flarum.settings')->get('default_route');
     if (isset($routes->getRouteData()[0]['GET'][$defaultRoute])) {
         $toDefaultController = $routes->getRouteData()[0]['GET'][$defaultRoute];
     }
     $routes->get('/', 'default', $toDefaultController);
     return $routes;
 }
 /**
  * Populate the API routes.
  *
  * @param RouteCollection $routes
  */
 protected function populateRoutes(RouteCollection $routes)
 {
     $toController = $this->getHandlerGenerator($this->app);
     // Get forum information
     $routes->get('/forum', 'forum.show', $toController('Flarum\\Api\\Controller\\ShowForumController'));
     // Retrieve authentication token
     $routes->post('/token', 'token', $toController('Flarum\\Api\\Controller\\TokenController'));
     // Send forgot password email
     $routes->post('/forgot', 'forgot', $toController('Flarum\\Api\\Controller\\ForgotPasswordController'));
     /*
     |--------------------------------------------------------------------------
     | Users
     |--------------------------------------------------------------------------
     */
     // List users
     $routes->get('/users', 'users.index', $toController('Flarum\\Api\\Controller\\ListUsersController'));
     // Register a user
     $routes->post('/users', 'users.create', $toController('Flarum\\Api\\Controller\\CreateUserController'));
     // Get a single user
     $routes->get('/users/{id}', 'users.show', $toController('Flarum\\Api\\Controller\\ShowUserController'));
     // Edit a user
     $routes->patch('/users/{id}', 'users.update', $toController('Flarum\\Api\\Controller\\UpdateUserController'));
     // Delete a user
     $routes->delete('/users/{id}', 'users.delete', $toController('Flarum\\Api\\Controller\\DeleteUserController'));
     // Upload avatar
     $routes->post('/users/{id}/avatar', 'users.avatar.upload', $toController('Flarum\\Api\\Controller\\UploadAvatarController'));
     // Remove avatar
     $routes->delete('/users/{id}/avatar', 'users.avatar.delete', $toController('Flarum\\Api\\Controller\\DeleteAvatarController'));
     /*
     |--------------------------------------------------------------------------
     | Notifications
     |--------------------------------------------------------------------------
     */
     // List notifications for the current user
     $routes->get('/notifications', 'notifications.index', $toController('Flarum\\Api\\Controller\\ListNotificationsController'));
     // Mark all notifications as read
     $routes->post('/notifications/read', 'notifications.readAll', $toController('Flarum\\Api\\Controller\\ReadAllNotificationsController'));
     // Mark a single notification as read
     $routes->patch('/notifications/{id}', 'notifications.update', $toController('Flarum\\Api\\Controller\\UpdateNotificationController'));
     /*
     |--------------------------------------------------------------------------
     | Discussions
     |--------------------------------------------------------------------------
     */
     // List discussions
     $routes->get('/discussions', 'discussions.index', $toController('Flarum\\Api\\Controller\\ListDiscussionsController'));
     // Create a discussion
     $routes->post('/discussions', 'discussions.create', $toController('Flarum\\Api\\Controller\\CreateDiscussionController'));
     // Show a single discussion
     $routes->get('/discussions/{id}', 'discussions.show', $toController('Flarum\\Api\\Controller\\ShowDiscussionController'));
     // Edit a discussion
     $routes->patch('/discussions/{id}', 'discussions.update', $toController('Flarum\\Api\\Controller\\UpdateDiscussionController'));
     // Delete a discussion
     $routes->delete('/discussions/{id}', 'discussions.delete', $toController('Flarum\\Api\\Controller\\DeleteDiscussionController'));
     /*
     |--------------------------------------------------------------------------
     | Posts
     |--------------------------------------------------------------------------
     */
     // List posts, usually for a discussion
     $routes->get('/posts', 'posts.index', $toController('Flarum\\Api\\Controller\\ListPostsController'));
     // Create a post
     $routes->post('/posts', 'posts.create', $toController('Flarum\\Api\\Controller\\CreatePostController'));
     // Show a single or multiple posts by ID
     $routes->get('/posts/{id}', 'posts.show', $toController('Flarum\\Api\\Controller\\ShowPostController'));
     // Edit a post
     $routes->patch('/posts/{id}', 'posts.update', $toController('Flarum\\Api\\Controller\\UpdatePostController'));
     // Delete a post
     $routes->delete('/posts/{id}', 'posts.delete', $toController('Flarum\\Api\\Controller\\DeletePostController'));
     /*
     |--------------------------------------------------------------------------
     | Groups
     |--------------------------------------------------------------------------
     */
     // List groups
     $routes->get('/groups', 'groups.index', $toController('Flarum\\Api\\Controller\\ListGroupsController'));
     // Create a group
     $routes->post('/groups', 'groups.create', $toController('Flarum\\Api\\Controller\\CreateGroupController'));
     // Edit a group
     $routes->patch('/groups/{id}', 'groups.update', $toController('Flarum\\Api\\Controller\\UpdateGroupController'));
     // Delete a group
     $routes->delete('/groups/{id}', 'groups.delete', $toController('Flarum\\Api\\Controller\\DeleteGroupController'));
     /*
     |--------------------------------------------------------------------------
     | Administration
     |--------------------------------------------------------------------------
     */
     // Toggle an extension
     $routes->patch('/extensions/{name}', 'extensions.update', $toController('Flarum\\Api\\Controller\\UpdateExtensionController'));
     // Uninstall an extension
     $routes->delete('/extensions/{name}', 'extensions.delete', $toController('Flarum\\Api\\Controller\\UninstallExtensionController'));
     // Update settings
     $routes->post('/settings', 'settings', $toController('Flarum\\Api\\Controller\\SetSettingsController'));
     // Update a permission
     $routes->post('/permission', 'permission', $toController('Flarum\\Api\\Controller\\SetPermissionController'));
     $this->app->make('events')->fire(new ConfigureApiRoutes($routes, $toController));
 }
 /**
  * @param RouteCollection $routes
  */
 protected function populateRoutes(RouteCollection $routes)
 {
     $route = $this->app->make(RouteHandlerFactory::class);
     $routes->get('/', 'index', $route->toController(Controller\IndexController::class));
     $routes->post('/', 'install', $route->toController(Controller\InstallController::class));
 }
Exemple #7
0
 protected function routes()
 {
     $this->app->instance('flarum.api.routes', $routes = new RouteCollection());
     // Get forum information
     $routes->get('/forum', 'flarum.api.forum.show', $this->action('Flarum\\Api\\Actions\\Forum\\ShowAction'));
     // Save forum information
     $routes->patch('/forum', 'flarum.api.forum.update', $this->action('Flarum\\Api\\Actions\\Forum\\UpdateAction'));
     // Retrieve authentication token
     $routes->post('/token', 'flarum.api.token', $this->action('Flarum\\Api\\Actions\\TokenAction'));
     // Send forgot password email
     $routes->post('/forgot', 'flarum.api.forgot', $this->action('Flarum\\Api\\Actions\\ForgotAction'));
     /*
     |--------------------------------------------------------------------------
     | Users
     |--------------------------------------------------------------------------
     */
     // List users
     $routes->get('/users', 'flarum.api.users.index', $this->action('Flarum\\Api\\Actions\\Users\\IndexAction'));
     // Register a user
     $routes->post('/users', 'flarum.api.users.create', $this->action('Flarum\\Api\\Actions\\Users\\CreateAction'));
     // Get a single user
     $routes->get('/users/{id}', 'flarum.api.users.show', $this->action('Flarum\\Api\\Actions\\Users\\ShowAction'));
     // Edit a user
     $routes->patch('/users/{id}', 'flarum.api.users.update', $this->action('Flarum\\Api\\Actions\\Users\\UpdateAction'));
     // Delete a user
     $routes->delete('/users/{id}', 'flarum.api.users.delete', $this->action('Flarum\\Api\\Actions\\Users\\DeleteAction'));
     // Upload avatar
     $routes->post('/users/{id}/avatar', 'flarum.api.users.avatar.upload', $this->action('Flarum\\Api\\Actions\\Users\\UploadAvatarAction'));
     // Remove avatar
     $routes->delete('/users/{id}/avatar', 'flarum.api.users.avatar.delete', $this->action('Flarum\\Api\\Actions\\Users\\DeleteAvatarAction'));
     /*
     |--------------------------------------------------------------------------
     | Activity
     |--------------------------------------------------------------------------
     */
     // List activity
     $routes->get('/activity', 'flarum.api.activity.index', $this->action('Flarum\\Api\\Actions\\Activity\\IndexAction'));
     // List notifications for the current user
     $routes->get('/notifications', 'flarum.api.notifications.index', $this->action('Flarum\\Api\\Actions\\Notifications\\IndexAction'));
     // Mark a single notification as read
     $routes->patch('/notifications/{id}', 'flarum.api.notifications.update', $this->action('Flarum\\Api\\Actions\\Notifications\\UpdateAction'));
     /*
     |--------------------------------------------------------------------------
     | Discussions
     |--------------------------------------------------------------------------
     */
     // List discussions
     $routes->get('/discussions', 'flarum.api.discussions.index', $this->action('Flarum\\Api\\Actions\\Discussions\\IndexAction'));
     // Create a discussion
     $routes->post('/discussions', 'flarum.api.discussions.create', $this->action('Flarum\\Api\\Actions\\Discussions\\CreateAction'));
     // Show a single discussion
     $routes->get('/discussions/{id}', 'flarum.api.discussions.show', $this->action('Flarum\\Api\\Actions\\Discussions\\ShowAction'));
     // Edit a discussion
     $routes->patch('/discussions/{id}', 'flarum.api.discussions.update', $this->action('Flarum\\Api\\Actions\\Discussions\\UpdateAction'));
     // Delete a discussion
     $routes->delete('/discussions/{id}', 'flarum.api.discussions.delete', $this->action('Flarum\\Api\\Actions\\Discussions\\DeleteAction'));
     /*
     |--------------------------------------------------------------------------
     | Posts
     |--------------------------------------------------------------------------
     */
     // List posts, usually for a discussion
     $routes->get('/posts', 'flarum.api.posts.index', $this->action('Flarum\\Api\\Actions\\Posts\\IndexAction'));
     // Create a post
     $routes->post('/posts', 'flarum.api.posts.create', $this->action('Flarum\\Api\\Actions\\Posts\\CreateAction'));
     // Show a single or multiple posts by ID
     $routes->get('/posts/{id}', 'flarum.api.posts.show', $this->action('Flarum\\Api\\Actions\\Posts\\ShowAction'));
     // Edit a post
     $routes->patch('/posts/{id}', 'flarum.api.posts.update', $this->action('Flarum\\Api\\Actions\\Posts\\UpdateAction'));
     // Delete a post
     $routes->delete('/posts/{id}', 'flarum.api.posts.delete', $this->action('Flarum\\Api\\Actions\\Posts\\DeleteAction'));
     /*
     |--------------------------------------------------------------------------
     | Groups
     |--------------------------------------------------------------------------
     */
     // List groups
     $routes->get('/groups', 'flarum.api.groups.index', $this->action('Flarum\\Api\\Actions\\Groups\\IndexAction'));
     // Create a group
     $routes->post('/groups', 'flarum.api.groups.create', $this->action('Flarum\\Api\\Actions\\Groups\\CreateAction'));
     // Edit a group
     $routes->patch('/groups/{id}', 'flarum.api.groups.update', $this->action('Flarum\\Api\\Actions\\Groups\\UpdateAction'));
     // Delete a group
     $routes->delete('/groups/{id}', 'flarum.api.groups.delete', $this->action('Flarum\\Api\\Actions\\Groups\\DeleteAction'));
     /*
     |--------------------------------------------------------------------------
     | Administration
     |--------------------------------------------------------------------------
     */
     // Toggle an extension
     $routes->patch('/extensions/{name}', 'flarum.api.extensions.update', $this->action('Flarum\\Api\\Actions\\Extensions\\UpdateAction'));
     // Uninstall an extension
     $routes->delete('/extensions/{name}', 'flarum.api.extensions.delete', $this->action('Flarum\\Api\\Actions\\Extensions\\DeleteAction'));
     // Update config settings
     $routes->post('/config', 'flarum.api.config', $this->action('Flarum\\Api\\Actions\\ConfigAction'));
     // Update a permission
     $routes->post('/permission', 'flarum.api.permission', $this->action('Flarum\\Api\\Actions\\PermissionAction'));
     event(new RegisterApiRoutes($routes));
 }
 protected function routes()
 {
     $this->app->instance('flarum.install.routes', $routes = new RouteCollection());
     $routes->get('/', 'flarum.install.index', $this->action('Flarum\\Install\\Actions\\IndexAction'));
     $routes->post('/', 'flarum.install.install', $this->action('Flarum\\Install\\Actions\\InstallAction'));
 }