Skip to content

Commit 02faad9

Browse files
authored
Fix broken links (#202)
1 parent 65ebcdc commit 02faad9

16 files changed

+32
-31
lines changed

docs/contributing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ A typical contribution workflow looks like this:
6565
1. 🚦 **Test** your code.
6666
* Add unit tests as necessary when fixing bugs or adding features.
6767
* Run the test suite with `vendor/bin/phpunit` in the relevant package folder.
68+
6869
<!--
6970
* See [here](link-to-core/tests/README.md) for more information about testing in Flarum.
7071
-->

docs/extend/authorization.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Each of these is determined by unique criteria: in some cases a flag is sufficie
1818

1919
### How It Works
2020

21-
Authorization queries are made with 3 parameters, with logic contained in [`Flarum\User\Gate`](https://api.docs.flarum.org/php/master/flarum/user/gate):
21+
Authorization queries are made with 3 parameters, with logic contained in [`Flarum\User\Gate`](https://api.docs.flarum.org/php/master/flarum/user/access/gate):
2222

2323
1. The actor: the user attempting to perform the action
2424
2. The ability: a string representing the action the actor is attempting
@@ -195,7 +195,7 @@ return [
195195
## Visibility Scoping
196196

197197
When a user visits the **All Discussions** page, we want to quickly show them the recent discussions that the user has access to.
198-
We do this via the `whereVisibleTo` method, which is defined in `Flarum\Database\ScopeVisibilityTrait`, and available to [Eloquent models and queries](https://laravel.com/docs/6.x/queries) through [Eloquent scoping](https://laravel.com/docs/6.x/eloquent#local-scopes).
198+
We do this via the `whereVisibleTo` method, which is defined in `Flarum\Database\ScopeVisibilityTrait`, and available to [Eloquent models and queries](https://laravel.com/docs/8.x/queries) through [Eloquent scoping](https://laravel.com/docs/8.x/eloquent#local-scopes).
199199
For example:
200200

201201
```php
@@ -224,7 +224,7 @@ This call is handled by Flarum's general model visibility scoping system, which
224224

225225
The query will be run through all applicable scopers registered for the model of the query. Note that visibility scopers registered for a parent class (like `Flarum\Post\Post`) will also be applied to any child classes (like `Flarum\Post\CommentPost`).
226226

227-
Note that scopers don't need to return anything, but rather should perform in-place mutations on the [Eloquent query object](https://laravel.com/docs/6.x/queries).
227+
Note that scopers don't need to return anything, but rather should perform in-place mutations on the [Eloquent query object](https://laravel.com/docs/8.x/queries).
228228

229229
### Custom Permission Strings
230230

@@ -277,7 +277,7 @@ Think of calling `whereVisibleTo` with a custom ability as a way for extensions
277277

278278
### Custom Visibility Scoper Examples
279279

280-
Let's take a look at some examples from [Flarum Tags](https://github.com/flarum/tags/blob/master/src/Access/TagPolicy).
280+
Let's take a look at some examples from [Flarum Tags](https://github.com/flarum/tags/blob/master/src/Access).
281281

282282
First, a scoper for the `Tag` model with the `view` ability:
283283

docs/extend/backend-events.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Backend Events
22

3-
Often, an extension will want to react to some events occuring elsewhere in Flarum. For instance, we might want to increment a counter when a new discussion is posted, send a welcome email when a user logs in for the first time, or add tags to a discussion before saving it to the database. These events are known as **domain events**, and are broadcasted across the framework through [Laravel's event system](https://laravel.com/docs/6.x/events).
3+
Often, an extension will want to react to some events occuring elsewhere in Flarum. For instance, we might want to increment a counter when a new discussion is posted, send a welcome email when a user logs in for the first time, or add tags to a discussion before saving it to the database. These events are known as **domain events**, and are broadcasted across the framework through [Laravel's event system](https://laravel.com/docs/8.x/events).
44

55
:::warning Old Event API
66
Historically, Flarum has used events for its extension API, emitting events like `GetDisplayName` or `ConfigureApiRoutes` to allow extensions to insert logic into various parts of Flarum. These events are gradually being phased out in favor of the declarative [extender system](start.md#extenders), and will be removed before stable. Domain events will not be removed.
@@ -43,7 +43,7 @@ class PostDeletedListener
4343
}
4444
```
4545

46-
As shown above, a listener class can be used instead of a callback. This allows you to [inject dependencies](https://laravel.com/docs/6.x/container) into your listener class via constructor parameters. In this example we resolve a translator instance, but we can inject anything we want/need.
46+
As shown above, a listener class can be used instead of a callback. This allows you to [inject dependencies](https://laravel.com/docs/8.x/container) into your listener class via constructor parameters. In this example we resolve a translator instance, but we can inject anything we want/need.
4747

4848
You can also listen to multiple events at once via an event subscriber. This is useful for grouping common functionality; for instance, if you want to update some metadata on changes to posts:
4949

docs/extend/data.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Migrations live inside a folder suitably named `migrations` in your extension's
2828

2929
### Migration Structure
3030

31-
In Flarum, migration files should **return an array** with two functions: `up` and `down`. The `up` function is used to add new tables, columns, or indexes to your database, while the `down` function should reverse these operations. These functions receive an instance of the [Laravel schema builder](https://laravel.com/docs/6.x/migrations#creating-tables) which you can use to alter the database schema:
31+
In Flarum, migration files should **return an array** with two functions: `up` and `down`. The `up` function is used to add new tables, columns, or indexes to your database, while the `down` function should reverse these operations. These functions receive an instance of the [Laravel schema builder](https://laravel.com/docs/8.x/migrations#creating-tables) which you can use to alter the database schema:
3232

3333
```php
3434
<?php
@@ -68,7 +68,7 @@ return Migration::createTable('users', function (Blueprint $table) {
6868
});
6969
```
7070

71-
When creating the table, you may use any of the schema builder's [column methods](https://laravel.com/docs/6.x/migrations#creating-columns) to define the table's columns.
71+
When creating the table, you may use any of the schema builder's [column methods](https://laravel.com/docs/8.x/migrations#creating-columns) to define the table's columns.
7272

7373
### Renaming Tables
7474

@@ -101,13 +101,13 @@ return Migration::renameColumns('users', ['from' => 'to']);
101101

102102
### Data Migrations (Advanced)
103103

104-
A migration doesn't have to change database structure: you could use a migration to insert, update, or delete rows in a table. For instance, you could use migrations to assign [custom permissions](permissions.md) to groups other than Admin, or provide some initial data for a custom Eloquent model. Since you have access to the [Eloquent Schema Builder](https://laravel.com/docs/6.x/migrations#creating-tables), anything is possible (although of course, you should be extremely cautious and test your extension extensively).
104+
A migration doesn't have to change database structure: you could use a migration to insert, update, or delete rows in a table. For instance, you could use migrations to assign [custom permissions](permissions.md) to groups other than Admin, or provide some initial data for a custom Eloquent model. Since you have access to the [Eloquent Schema Builder](https://laravel.com/docs/8.x/migrations#creating-tables), anything is possible (although of course, you should be extremely cautious and test your extension extensively).
105105

106106
Data migrations are the recommended way to specify default settings and permissions.
107107

108108
## Backend Models
109109

110-
With all your snazzy new database tables and columns, you're going to want a way to access the data in both the backend and the frontend. On the backend it's pretty straightforward – you just need to be familiar with [Eloquent](https://laravel.com/docs/6.x/eloquent).
110+
With all your snazzy new database tables and columns, you're going to want a way to access the data in both the backend and the frontend. On the backend it's pretty straightforward – you just need to be familiar with [Eloquent](https://laravel.com/docs/8.x/eloquent).
111111

112112
### Adding New Models
113113

@@ -141,7 +141,7 @@ return [
141141

142142
### Relationships
143143

144-
You can also add [relationships](https://laravel.com/docs/6.x/eloquent-relationships) to existing models using the `hasOne`, `belongsTo`, `hasMany`, `belongsToMany`and `relationship` methods on the `Model` extender. The first argument is the relationship name; the rest of the arguments are passed into the equivalent method on the model, so you can specify the related model name and optionally override table and key names:
144+
You can also add [relationships](https://laravel.com/docs/8.x/eloquent-relationships) to existing models using the `hasOne`, `belongsTo`, `hasMany`, `belongsToMany`and `relationship` methods on the `Model` extender. The first argument is the relationship name; the rest of the arguments are passed into the equivalent method on the model, so you can specify the related model name and optionally override table and key names:
145145

146146
```php
147147
new Extend\Model(User::class)

docs/extend/frontend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Only one main JavaScript file per extension is permitted. If you need to include
174174

175175
### CSS
176176

177-
You can also add CSS and [LESS](http://lesscss.org/features/) assets to the frontend using the `Frontend` extender's `css` method:
177+
You can also add CSS and [LESS](https://lesscss.org/features/) assets to the frontend using the `Frontend` extender's `css` method:
178178

179179
```php
180180
(new Extend\Frontend('forum'))

docs/extend/i18n.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ This shows the basic translation method, with no bells or whistles attached. Bel
125125

126126
## Including Variables
127127

128-
You can include variables in translations. As an example, let's look at the code that creates the first item in Flarum's [search results dropdown](https://github.com/flarum/core/blob/master/js/forum/src/components/DiscussionsSearchSource.js). This button quotes the search query entered by the user &mdash; information that is passed to the translator along with the translation key, as an additional parameter:
128+
You can include variables in translations. As an example, let's look at the code that creates the first item in Flarum's [search results dropdown](https://github.com/flarum/core/blob/master/js/src/forum/components/DiscussionsSearchSource.js). This button quotes the search query entered by the user &mdash; information that is passed to the translator along with the translation key, as an additional parameter:
129129

130130
```jsx harmony
131131
{LinkButton.component({
@@ -181,7 +181,7 @@ return app.translator.transChoice(
181181
);
182182
```
183183

184-
This example is from the [Choose Tags modal](https://github.com/flarum/tags/blob/master/js/forum/src/components/TagDiscussionModal.js) of the Tags extension, where it tells the user how many more primary tags can be selected. Note that the `remaining` variable is passed to the translator **twice**. First, it appears as itself, to condition the pluralization of the word "tags". Then it appears again as the value of the `count` parameter, which the translator can use to insert that value in the translation.
184+
This example is from the [Choose Tags modal](https://github.com/flarum/tags/blob/master/js/src/forum/components/TagDiscussionModal.js) of the Tags extension, where it tells the user how many more primary tags can be selected. Note that the `remaining` variable is passed to the translator **twice**. First, it appears as itself, to condition the pluralization of the word "tags". Then it appears again as the value of the `count` parameter, which the translator can use to insert that value in the translation.
185185

186186
When the `app.translator.transChoice()` method is called, the translator scans the translation for a variant that matches the sort of pluralization required by the value of the variable. These variants need to be listed serially &mdash; singular form first, then plural forms in order of increasing magnitude &mdash; and separated using the vertical line (`|`) character. Here's the English translation for the above code:
187187

@@ -360,7 +360,7 @@ core:
360360

361361
It would very easy to change the translation for the header link without realizing that you're also changing things in the Log In modal &mdash; to say nothing of any extensions that might also be referencing that key! This sort of thing will be less likely to occur if you keep your reused translations in the `ref` namespace.
362362

363-
For this reason, any key references in the [core resources](https://github.com/flarum/lang-english/blob/master/locale/core.yml) **must** point to keys in the `core.ref` namespace. Key references in the resources for bundled extensions may point to either of two locations:
363+
For this reason, any key references in the [core resources](https://github.com/flarum/core/blob/master/locale/core.yml) **must** point to keys in the `core.ref` namespace. Key references in the resources for bundled extensions may point to either of two locations:
364364

365365
- Extension-specific translations should go in the `ref` namespace of the extension's locale file.
366366

@@ -402,7 +402,7 @@ Generally speaking, any displayed text that isn't supplied by a variable or the
402402

403403
Hardcoded text isn't the only way that code can create problems for localizers. Hardcoded syntax issues occur when the code forces words into a specific order that just won't work in other languages. They are generally the result of using two translations where just one would be more appropriate.
404404

405-
For an example, let's look at the line of text that's printed near the bottom of the [Log In modal](https://github.com/flarum/core/blob/master/js/forum/src/components/LogInModal.js):
405+
For an example, let's look at the line of text that's printed near the bottom of the [Log In modal](https://github.com/flarum/core/blob/master/js/src/forum/components/LogInModal.js):
406406

407407
> Don't have an account? [Sign Up](#)
408408

@@ -439,9 +439,9 @@ They are surprisingly easy to overlook. Of course, the need for pluralization su
439439
> You like this.
440440
> Toby and Franz like this.
441441

442-
And the situation is complicated by the presence of the second-person pronoun, since it always takes the plural form in English, even when we're talking about one person. That's why the `app.translator` call is so complicated in the code that outputs the above sentences for the [Likes extension](https://github.com/flarum/likes/blob/master/js/forum/src/addLikesList.js).
442+
And the situation is complicated by the presence of the second-person pronoun, since it always takes the plural form in English, even when we're talking about one person. That's why the `app.translator` call is so complicated in the code that outputs the above sentences for the [Likes extension](https://github.com/flarum/likes/blob/master/js/src/forum/addLikesList.js).
443443

444-
Now look at this similar set of sentences, output by similar code in the [Mentions extension](https://github.com/flarum/mentions/blob/master/js/forum/src/addMentionedByList.js):
444+
Now look at this similar set of sentences, output by similar code in the [Mentions extension](https://github.com/flarum/mentions/blob/master/js/src/forum/addMentionedByList.js):
445445

446446
> Toby replied to this.
447447
> You replied to this.

docs/extend/interactive-components.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ More information about methods available to override is available in our [API do
6868

6969
Since Flarum is a forum, we need tools for users to be able to create and edit posts and discussions. Flarum accomplishes this through the floating composer component.
7070

71-
The composer is managed by a global instance of [`ComposerState`]([https://api.docs.flarum.org/js/master/class/src/common/states/modalmanagerstate.js~modalmanagerstate), which is accessible via `app.composer` on the `forum` frontend. Its most important public methods are:
71+
The composer is managed by a global instance of [`ComposerState`](https://api.docs.flarum.org/js/master/class/src/common/states/modalmanagerstate.js~modalmanagerstate), which is accessible via `app.composer` on the `forum` frontend. Its most important public methods are:
7272

7373
- `app.composer.load(componentClass, attrs)` will load in a new composer type. If a composer is already active, it will be replaced.
7474
- `app.composer.show()` will show the composer if it is currently hidden.
@@ -84,5 +84,5 @@ This is done by splitting code for each usage into a subclass of `flarum/forum/c
8484
### Composer Editor
8585

8686
The actual editor is yet another component, [`flarum/common/components/TextEditor`](https://api.docs.flarum.org/js/master/class/src/common/components/texteditor.js~texteditor).
87-
Its state can be programatically accessed via an "editor driver", which implements [`EditorDriverInterface`](https://github.com/flarum/core/blob/7d79912d3651f49e045302946b99a562f791b730/js/src/common/utils/EditorDriverInterface.ts).
87+
Its state can be programatically accessed via an "editor driver", which implements [`EditorDriverInterface`](https://github.com/flarum/core/blob/master/js/src/common/utils/EditorDriverInterface.ts).
8888
This is globally available for the current composer via `app.composer.editor`, and allows extensions to programatically read, insert, and modify the current contents, selections, and cursor position of the active composer's text editor.

docs/extend/notifications.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ In addition to registering our notification to send by email, if we actually wan
9999
To do this, your notification blueprint should implement [`Flarum\Notification\MailableInterface`](https://api.docs.flarum.org/php/master/flarum/notification/mailableinterface) in addition to [`Flarum\Notification\Blueprint\BlueprintInterface`](https://api.docs.flarum.org/php/master/flarum/notification/blueprint/blueprintinterface).
100100
This comes with 2 additional methods:
101101

102-
- `getEmailView()` should return an array of email type to [Blade View](https://laravel.com/docs/6.x/blade) names. The namespaces for these views must [first be registered](routes.md#views). These will be used to generate the body of the email.
102+
- `getEmailView()` should return an array of email type to [Blade View](https://laravel.com/docs/8.x/blade) names. The namespaces for these views must [first be registered](routes.md#views). These will be used to generate the body of the email.
103103
- `getEmailSubject(TranslatorInterface $translator)` should return a string for the email subject. An instance of the translator is passed in to enable translated notification emails.
104104

105105
Let's take a look at an example from [Flarum Mentions](https://github.com/flarum/mentions/blob/master/src/Notification/PostMentionedBlueprint.php)

docs/extend/routes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class HelloWorldController implements RequestHandlerInterface
5959
}
6060
```
6161

62-
Controllers are resolved from the [container](https://laravel.com/docs/6.x/container) so you can inject dependencies into their constructors.
62+
Controllers are resolved from the [container](https://laravel.com/docs/8.x/container) so you can inject dependencies into their constructors.
6363

6464
:::tip What are Controllers?
6565
The `handle` method of a Controller is the code that runs when someone visits your route (or sends data to it via a form submission). Generally speaking, Controller implementations follow the pattern:
@@ -97,7 +97,7 @@ $url = $this->url->to('forum')->route('acme.user', ['id' => 123, 'foo' => 'bar']
9797

9898
### Views
9999

100-
You can inject Laravel's [View](https://laravel.com/docs/6.x/views) factory into your controller. This will allow you to render a [Blade template](https://laravel.com/docs/6.x/blade) into your controller's response.
100+
You can inject Laravel's [View](https://laravel.com/docs/8.x/views) factory into your controller. This will allow you to render a [Blade template](https://laravel.com/docs/8.x/blade) into your controller's response.
101101

102102
First, you will need to tell the view factory where it can find your extension's view files by adding a `View` extender to `extend.php`:
103103

0 commit comments

Comments
 (0)