The front-end makes use of a utility class (specified in the
forum.frontend.utility_class config value) to facilitate a few common actions. This is automatically aliased to
Forum for ease of use in views.
Forum::alert('success', 'categories.updated', $categories->count());
Flashes alert messages to the session to be displayed on the next request. Note that validation messages are independent of this and follow Laravel’s convention; in this context, alerts are forum-specific ‘success’ or ‘warning’ messages.
Parses the given content and returns the “rendered” version. This is used for post content by default, but could extend to category descriptions.
Forum::route('forum.index'); Forum::route('thread.show', $thread);
route() helper function to generate URLs for forum routes. Since forum front-end routes contain many parameters, generating URLs for them with
route() can be cumbersome, especially in views. To make this easier,
Forum::route() simply accepts a route name (with or without the preceding
forum.) and a
Post model. The route parameters are automatically extracted from the model.
Defines all of the standard routes. By default, if
forum.routing.enabled is true, this is automatically called inside a route group with ‘prefix’, ‘as’ and ‘middleware’ set to
Tip: You can disable routing and call this in your own route definitions if you prefer; just remember to set the ‘as’ property of any forum route group you define to
Forum::route()may be unable to identify forum routes correctly.
Generates a URL-friendly version of the given string. By default, this simply passes the string through Laravel’s
str_slug() and is used by
Forum::route(). You’ll probably want to override this if your forum is going to contain categories and threads with unicode titles.