├── v1
├── upgrade-guides
│ ├── core.md
│ ├── translation.md
│ ├── platform.md
│ ├── menu.md
│ ├── workshop.md
│ ├── setting.md
│ ├── page.md
│ └── user.md
├── media-module
│ ├── index.md
│ ├── refreshing-thumbnails.md
│ ├── getting-a-thumbnail.md
│ ├── events.md
│ └── configuration.md
├── core-module
│ ├── index.md
│ ├── helpers.md
│ ├── configuration.md
│ ├── repositories.md
│ └── permissions.md
├── setting-module
│ ├── index.md
│ ├── custom-fields.md
│ ├── events.md
│ ├── available-fields.md
│ ├── adding-settings.md
│ └── reading-settings.md
├── menu-module
│ └── managing-menus.md
├── user-module
│ ├── events.md
│ ├── middleware.md
│ ├── users.md
│ ├── configuration.md
│ └── drivers.md
├── workshop-module
│ ├── theme-scaffold.md
│ └── module-scaffold.md
├── getting-started
│ └── used-technology.md
├── page-module
│ └── custom-fields.md
└── dashboard-module
│ └── widgets.md
├── readme.md
├── v2
├── upgrade-guides
│ ├── translation.md
│ ├── menu.md
│ ├── workshop.md
│ ├── setting.md
│ ├── page.md
│ └── platform.md
├── media-module
│ ├── index.md
│ ├── media-hooks.md
│ ├── events.md
│ └── configuration.md
├── tag-module
│ ├── events.md
│ ├── tag-hooks.md
│ └── convenience-methods.md
├── core-module
│ ├── index.md
│ ├── helpers.md
│ ├── repositories.md
│ └── configuration.md
├── setting-module
│ ├── index.md
│ ├── custom-fields.md
│ ├── events.md
│ ├── available-fields.md
│ ├── setting-hooks.md
│ └── adding-settings.md
├── menu-module
│ ├── managing-menus.md
│ ├── events.md
│ └── menu-hooks.md
├── workshop-module
│ ├── theme-scaffold.md
│ ├── module-scaffold.md
│ └── generate-entity-files.md
├── user-module
│ ├── user-hooks.md
│ ├── events.md
│ ├── users.md
│ ├── drivers.md
│ └── middleware.md
├── getting-started
│ └── used-technology.md
├── page-module
│ ├── custom-fields.md
│ └── page-hooks.md
└── dashboard-module
│ └── widgets.md
├── v3
├── upgrade-guides
│ ├── tag.md
│ ├── media.md
│ ├── menu.md
│ ├── setting.md
│ ├── translation.md
│ ├── core.md
│ ├── workshop.md
│ ├── page.md
│ └── user.md
├── media-module
│ ├── index.md
│ ├── media-hooks.md
│ ├── events.md
│ └── configuration.md
├── tag-module
│ ├── events.md
│ ├── tag-hooks.md
│ └── convenience-methods.md
├── core-module
│ ├── index.md
│ ├── helpers.md
│ ├── repositories.md
│ └── configuration.md
├── setting-module
│ ├── index.md
│ ├── custom-fields.md
│ ├── events.md
│ ├── available-fields.md
│ ├── setting-hooks.md
│ └── adding-settings.md
├── menu-module
│ ├── managing-menus.md
│ ├── events.md
│ └── menu-hooks.md
├── workshop-module
│ ├── theme-scaffold.md
│ ├── module-scaffold.md
│ └── generate-entity-files.md
├── user-module
│ ├── user-hooks.md
│ ├── events.md
│ ├── users.md
│ ├── drivers.md
│ └── middleware.md
├── getting-started
│ └── used-technology.md
├── page-module
│ ├── custom-fields.md
│ └── page-hooks.md
└── dashboard-module
│ └── widgets.md
└── v4
├── upgrade-guides
├── tag.md
├── media.md
├── menu.md
├── setting.md
├── translation.md
├── core.md
├── workshop.md
├── page.md
└── user.md
├── media-module
├── index.md
├── media-hooks.md
├── events.md
└── configuration.md
├── tag-module
├── events.md
├── tag-hooks.md
└── convenience-methods.md
├── core-module
├── index.md
├── helpers.md
├── repositories.md
└── configuration.md
├── setting-module
├── index.md
├── custom-fields.md
├── events.md
├── available-fields.md
├── setting-hooks.md
└── adding-settings.md
├── menu-module
├── managing-menus.md
├── events.md
└── menu-hooks.md
├── workshop-module
├── theme-scaffold.md
├── module-scaffold.md
└── generate-entity-files.md
├── user-module
├── user-hooks.md
├── events.md
├── users.md
├── drivers.md
└── middleware.md
├── getting-started
└── used-technology.md
├── page-module
├── custom-fields.md
└── page-hooks.md
└── dashboard-module
└── widgets.md
/v1/upgrade-guides/core.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Core module
3 | -------
4 |
5 | > Nothing to see here yet.
6 |
--------------------------------------------------------------------------------
/v1/upgrade-guides/translation.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Translation module
3 | -------
4 |
5 | > Nothing to see here yet.
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # AsgardCMS Documentation
2 |
3 | This is the repository containing the documentation found on the [Documentation Site](https://asgardcms.com/docs/v2/getting-started/installation).
--------------------------------------------------------------------------------
/v2/upgrade-guides/translation.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Translation module
3 | -------
4 |
5 | - [From v1 to v2](#upgrade-2.0)
6 |
7 |
8 |
9 | ## From v1 to **v2**
10 |
11 | **[> Changelog](https://github.com/AsgardCms/Translation/blob/2.0/changelog.yml)**
12 |
13 | No breaking changes.
--------------------------------------------------------------------------------
/v3/upgrade-guides/tag.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Tag module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 |
9 | ## From v2 to **v3**
10 |
11 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Tag/changelog.yml)**
12 |
13 | **Sidebar: Tag menu item weight**
14 |
15 | The tag menu item weight has been changed to `50`.
16 |
--------------------------------------------------------------------------------
/v4/upgrade-guides/tag.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Tag module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 |
9 | ## From v2 to **v3**
10 |
11 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Tag/changelog.yml)**
12 |
13 | **Sidebar: Tag menu item weight**
14 |
15 | The tag menu item weight has been changed to `50`.
16 |
--------------------------------------------------------------------------------
/v3/upgrade-guides/media.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Media module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 | ## From v2 to **v3**
9 |
10 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Media/changelog.yml)**
11 |
12 | **Sidebar: Media menu item weight**
13 |
14 | The media menu item weight has been changed to `20`.
15 |
--------------------------------------------------------------------------------
/v3/upgrade-guides/menu.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Menu module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 |
9 | ## From v2 to **v3**
10 |
11 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Menu/changelog.yml)**
12 |
13 | **Sidebar: Menu menu item weight**
14 |
15 | The menu menu item weight has been changed to `30`.
16 |
--------------------------------------------------------------------------------
/v4/upgrade-guides/media.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Media module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 | ## From v2 to **v3**
9 |
10 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Media/changelog.yml)**
11 |
12 | **Sidebar: Media menu item weight**
13 |
14 | The media menu item weight has been changed to `20`.
15 |
--------------------------------------------------------------------------------
/v4/upgrade-guides/menu.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Menu module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 |
9 | ## From v2 to **v3**
10 |
11 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Menu/changelog.yml)**
12 |
13 | **Sidebar: Menu menu item weight**
14 |
15 | The menu menu item weight has been changed to `30`.
16 |
--------------------------------------------------------------------------------
/v1/media-module/index.md:
--------------------------------------------------------------------------------
1 | # Media Module
2 |
3 | The media module gives you the ability to handle are your media files. It also provides a easy and clean way to create thumbnails for your images with a whole bunch of effects (blur, brighten, contrast and many more).
4 |
5 | 1. [Thumbnails](/Media-Module/thumbnails.md)
6 | 2. [Getting thumbnail](/Media-Module/getting-a-thumbnail.md)
7 | 3. [Refreshing thumbnails](/Media-Module/refreshing-thumbnails.md)
--------------------------------------------------------------------------------
/v2/media-module/index.md:
--------------------------------------------------------------------------------
1 | # Media Module
2 |
3 | The media module gives you the ability to handle are your media files. It also provides a easy and clean way to create thumbnails for your images with a whole bunch of effects (blur, brighten, contrast and many more).
4 |
5 | 1. [Thumbnails](/Media-Module/thumbnails.md)
6 | 2. [Getting thumbnail](/Media-Module/getting-a-thumbnail.md)
7 | 3. [Refreshing thumbnails](/Media-Module/refreshing-thumbnails.md)
--------------------------------------------------------------------------------
/v3/media-module/index.md:
--------------------------------------------------------------------------------
1 | # Media Module
2 |
3 | The media module gives you the ability to handle are your media files. It also provides a easy and clean way to create thumbnails for your images with a whole bunch of effects (blur, brighten, contrast and many more).
4 |
5 | 1. [Thumbnails](/Media-Module/thumbnails.md)
6 | 2. [Getting thumbnail](/Media-Module/getting-a-thumbnail.md)
7 | 3. [Refreshing thumbnails](/Media-Module/refreshing-thumbnails.md)
--------------------------------------------------------------------------------
/v4/media-module/index.md:
--------------------------------------------------------------------------------
1 | # Media Module
2 |
3 | The media module gives you the ability to handle are your media files. It also provides a easy and clean way to create thumbnails for your images with a whole bunch of effects (blur, brighten, contrast and many more).
4 |
5 | 1. [Thumbnails](/Media-Module/thumbnails.md)
6 | 2. [Getting thumbnail](/Media-Module/getting-a-thumbnail.md)
7 | 3. [Refreshing thumbnails](/Media-Module/refreshing-thumbnails.md)
--------------------------------------------------------------------------------
/v3/upgrade-guides/setting.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Setting module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 |
9 | ## From v2 to **v3**
10 |
11 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Setting/changelog.yml)**
12 |
13 | **Sidebar: Setting menu item weight**
14 |
15 | The setting menu item weight has been changed to `20`.
16 |
17 |
18 |
--------------------------------------------------------------------------------
/v4/upgrade-guides/setting.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Setting module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 |
9 | ## From v2 to **v3**
10 |
11 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Setting/changelog.yml)**
12 |
13 | **Sidebar: Setting menu item weight**
14 |
15 | The setting menu item weight has been changed to `20`.
16 |
17 |
18 |
--------------------------------------------------------------------------------
/v3/upgrade-guides/translation.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Translation module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 |
9 | ## From v2 to **v3**
10 |
11 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Translation/changelog.yml)**
12 |
13 | **Sidebar: Translation menu item weight**
14 |
15 | The translation menu item weight has been changed to `40`.
16 |
--------------------------------------------------------------------------------
/v4/upgrade-guides/translation.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Translation module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 |
9 | ## From v2 to **v3**
10 |
11 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Translation/changelog.yml)**
12 |
13 | **Sidebar: Translation menu item weight**
14 |
15 | The translation menu item weight has been changed to `40`.
16 |
--------------------------------------------------------------------------------
/v3/upgrade-guides/core.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Core module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 | ## From v2 to **v3**
9 |
10 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Core/changelog.yml)**
11 |
12 | **Authorization middleware**
13 |
14 | The `Authorization` middleware now returns a 403 forbidden when a permission is missing, instead of 401.
15 |
--------------------------------------------------------------------------------
/v4/upgrade-guides/core.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Core module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 | ## From v2 to **v3**
9 |
10 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Core/changelog.yml)**
11 |
12 | **Authorization middleware**
13 |
14 | The `Authorization` middleware now returns a 403 forbidden when a permission is missing, instead of 401.
15 |
--------------------------------------------------------------------------------
/v1/upgrade-guides/platform.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Platform
3 | -------
4 |
5 | - [From 1.12.0 to 1.13.0](#upgrade-1.13.0)
6 |
7 | ## From 1.12.0 to **1.13.0**
8 |
9 | **New Job class**
10 |
11 | The laravel abstract `Job` class has been added in `app/Jobs/Job.php`. Add the `Job` class ([view class](https://github.com/AsgardCms/Platform/blob/master/app/Jobs/Job.php)) to your project in that same location (`app/Jobs/Job.php`).
12 |
--------------------------------------------------------------------------------
/v3/upgrade-guides/workshop.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Workshop module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 | ## From v2 to **v3**
9 |
10 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Workshop/changelog.yml)**
11 |
12 | **Sidebar: Workshop menu item weight**
13 |
14 | The modules menu item weight has been changed to `30`.
15 | The themes menu item weight has been changed to `40`.
16 |
17 |
--------------------------------------------------------------------------------
/v4/upgrade-guides/workshop.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Workshop module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 | ## From v2 to **v3**
9 |
10 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Workshop/changelog.yml)**
11 |
12 | **Sidebar: Workshop menu item weight**
13 |
14 | The modules menu item weight has been changed to `30`.
15 | The themes menu item weight has been changed to `40`.
16 |
17 |
--------------------------------------------------------------------------------
/v3/upgrade-guides/page.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Page module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 | ## From v2 to **v3**
9 |
10 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Page/changelog.yml)**
11 |
12 | **Single Page Application**
13 |
14 | If you have overwritten page module views, make sure to update them to the latest versions.
15 |
16 | **Sidebar: Page menu item weight**
17 |
18 | The page menu item weight has been changed to `10`.
19 |
--------------------------------------------------------------------------------
/v4/upgrade-guides/page.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Page module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 | ## From v2 to **v3**
9 |
10 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/Page/changelog.yml)**
11 |
12 | **Single Page Application**
13 |
14 | If you have overwritten page module views, make sure to update them to the latest versions.
15 |
16 | **Sidebar: Page menu item weight**
17 |
18 | The page menu item weight has been changed to `10`.
19 |
--------------------------------------------------------------------------------
/v2/tag-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: Tag Module
3 | -------
4 |
5 | The following events are triggered in the Tag Module:
6 |
7 | - [TagWasCreated](#tag-was-created)
8 | - [TagWasUpdated](#tag-was-updated)
9 |
10 |
11 | ## TagWasCreated
12 |
13 | Triggered when a tag was created. You have access to the created tag.
14 |
15 | ## TagWasUpdated
16 |
17 | Triggered when a tag was updated. You have access to the updated tag.
18 |
--------------------------------------------------------------------------------
/v3/tag-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: Tag Module
3 | -------
4 |
5 | The following events are triggered in the Tag Module:
6 |
7 | - [TagWasCreated](#tag-was-created)
8 | - [TagWasUpdated](#tag-was-updated)
9 |
10 |
11 | ## TagWasCreated
12 |
13 | Triggered when a tag was created. You have access to the created tag.
14 |
15 | ## TagWasUpdated
16 |
17 | Triggered when a tag was updated. You have access to the updated tag.
18 |
--------------------------------------------------------------------------------
/v4/tag-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: Tag Module
3 | -------
4 |
5 | The following events are triggered in the Tag Module:
6 |
7 | - [TagWasCreated](#tag-was-created)
8 | - [TagWasUpdated](#tag-was-updated)
9 |
10 |
11 | ## TagWasCreated
12 |
13 | Triggered when a tag was created. You have access to the created tag.
14 |
15 | ## TagWasUpdated
16 |
17 | Triggered when a tag was updated. You have access to the updated tag.
18 |
--------------------------------------------------------------------------------
/v1/core-module/index.md:
--------------------------------------------------------------------------------
1 | # Core Module
2 |
3 | The Core Module is the base of every other module. It contains base classes that other modules can extend. It also offers the functionality for other modules to add a menu item in the dashboard. The core module also has the base layout and some partials.
4 |
5 | We'll go over all its functionalities in this series of documents.
6 |
7 | 1. [Navigation](/Core-Module/Navigation.md)
8 | 2. [Permissions](/Core-Module/Permissions.md)
9 | 3. [Repositories](/Core-Module/Repositories.md)
10 | 4. [Configuration](/Core-Module/Configuration.md)
11 |
12 |
13 | ***
14 |
15 | [Back to ToC](../readme.md)
--------------------------------------------------------------------------------
/v2/core-module/index.md:
--------------------------------------------------------------------------------
1 | # Core Module
2 |
3 | The Core Module is the base of every other module. It contains base classes that other modules can extend. It also offers the functionality for other modules to add a menu item in the dashboard. The core module also has the base layout and some partials.
4 |
5 | We'll go over all its functionalities in this series of documents.
6 |
7 | 1. [Navigation](/Core-Module/Navigation.md)
8 | 2. [Permissions](/Core-Module/Permissions.md)
9 | 3. [Repositories](/Core-Module/Repositories.md)
10 | 4. [Configuration](/Core-Module/Configuration.md)
11 |
12 |
13 | ***
14 |
15 | [Back to ToC](../readme.md)
--------------------------------------------------------------------------------
/v3/core-module/index.md:
--------------------------------------------------------------------------------
1 | # Core Module
2 |
3 | The Core Module is the base of every other module. It contains base classes that other modules can extend. It also offers the functionality for other modules to add a menu item in the dashboard. The core module also has the base layout and some partials.
4 |
5 | We'll go over all its functionalities in this series of documents.
6 |
7 | 1. [Navigation](/Core-Module/Navigation.md)
8 | 2. [Permissions](/Core-Module/Permissions.md)
9 | 3. [Repositories](/Core-Module/Repositories.md)
10 | 4. [Configuration](/Core-Module/Configuration.md)
11 |
12 |
13 | ***
14 |
15 | [Back to ToC](../readme.md)
--------------------------------------------------------------------------------
/v4/core-module/index.md:
--------------------------------------------------------------------------------
1 | # Core Module
2 |
3 | The Core Module is the base of every other module. It contains base classes that other modules can extend. It also offers the functionality for other modules to add a menu item in the dashboard. The core module also has the base layout and some partials.
4 |
5 | We'll go over all its functionalities in this series of documents.
6 |
7 | 1. [Navigation](/Core-Module/Navigation.md)
8 | 2. [Permissions](/Core-Module/Permissions.md)
9 | 3. [Repositories](/Core-Module/Repositories.md)
10 | 4. [Configuration](/Core-Module/Configuration.md)
11 |
12 |
13 | ***
14 |
15 | [Back to ToC](../readme.md)
--------------------------------------------------------------------------------
/v1/upgrade-guides/menu.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Menu module
3 | -------
4 |
5 | - [From 1.13.0 to 1.14.0](#upgrade-1.14.0)
6 |
7 | ## From 1.13.0 to **1.14.0**
8 |
9 | **Translations have been removed**
10 |
11 | All translations files were removed from the individual modules and moved to the [Translation](https://github.com/AsgardCms/Translation) module. Therefore you will need to require the Translation module in your project. This can be done by running the following command in your project:
12 |
13 | ``` .language-bash
14 | composer require asgardcms/translation-module
15 | ```
16 |
17 |
--------------------------------------------------------------------------------
/v1/upgrade-guides/workshop.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Workshop module
3 | -------
4 |
5 | - [From 1.11.0 to 1.12.0](#upgrade-1.12.0)
6 |
7 | ## From 1.11.0 to **1.12.0**
8 |
9 | **Translations have been removed**
10 |
11 | All translations files were removed from the individual modules and moved to the [Translation](https://github.com/AsgardCms/Translation) module. Therefore you will need to require the Translation module in your project. This can be done by running the following command in your project:
12 |
13 | ``` .language-bash
14 | composer require asgardcms/translation-module
15 | ```
16 |
--------------------------------------------------------------------------------
/v1/upgrade-guides/setting.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Setting module
3 | -------
4 |
5 | - [From 1.12.1 to 1.13.0](#upgrade-1.13.0)
6 |
7 | ## From 1.12.1 to **1.13.0**
8 |
9 | **Translations have been removed**
10 |
11 | All translations files were removed from the individual modules and moved to the [Translation](https://github.com/AsgardCms/Translation) module. Therefore you will need to require the Translation module in your project. This can be done by running the following command in your project:
12 |
13 | ``` .language-bash
14 | composer require asgardcms/translation-module
15 | ```
16 |
17 |
--------------------------------------------------------------------------------
/v1/setting-module/index.md:
--------------------------------------------------------------------------------
1 | # Setting module
2 |
3 | The settings module is the **one** place to manage all the settings. It listens to a `config/settings.php` file for instructions and displays the settings for the module.
4 |
5 | This means every module can, independently, specify which settings they need, and the Setting module will display and handle the storage of those settings.
6 |
7 | 1. [Adding settings](/Setting-Module/adding-settings.md)
8 | 2. [Available fields](/Setting-Module/available-fields.md)
9 | 2. [Reading settings](/Setting-Module/reading-settings.md)
10 | 3. [Custom fields](/Setting-Module/custom-fields.md)
11 |
12 |
13 | ***
14 |
15 | [Back to ToC](../readme.md)
--------------------------------------------------------------------------------
/v2/setting-module/index.md:
--------------------------------------------------------------------------------
1 | # Setting module
2 |
3 | The settings module is the **one** place to manage all the settings. It listens to a `config/settings.php` file for instructions and displays the settings for the module.
4 |
5 | This means every module can, independently, specify which settings they need, and the Setting module will display and handle the storage of those settings.
6 |
7 | 1. [Adding settings](/Setting-Module/adding-settings.md)
8 | 2. [Available fields](/Setting-Module/available-fields.md)
9 | 2. [Reading settings](/Setting-Module/reading-settings.md)
10 | 3. [Custom fields](/Setting-Module/custom-fields.md)
11 |
12 |
13 | ***
14 |
15 | [Back to ToC](../readme.md)
--------------------------------------------------------------------------------
/v3/setting-module/index.md:
--------------------------------------------------------------------------------
1 | # Setting module
2 |
3 | The settings module is the **one** place to manage all the settings. It listens to a `config/settings.php` file for instructions and displays the settings for the module.
4 |
5 | This means every module can, independently, specify which settings they need, and the Setting module will display and handle the storage of those settings.
6 |
7 | 1. [Adding settings](/Setting-Module/adding-settings.md)
8 | 2. [Available fields](/Setting-Module/available-fields.md)
9 | 2. [Reading settings](/Setting-Module/reading-settings.md)
10 | 3. [Custom fields](/Setting-Module/custom-fields.md)
11 |
12 |
13 | ***
14 |
15 | [Back to ToC](../readme.md)
--------------------------------------------------------------------------------
/v4/setting-module/index.md:
--------------------------------------------------------------------------------
1 | # Setting module
2 |
3 | The settings module is the **one** place to manage all the settings. It listens to a `config/settings.php` file for instructions and displays the settings for the module.
4 |
5 | This means every module can, independently, specify which settings they need, and the Setting module will display and handle the storage of those settings.
6 |
7 | 1. [Adding settings](/Setting-Module/adding-settings.md)
8 | 2. [Available fields](/Setting-Module/available-fields.md)
9 | 2. [Reading settings](/Setting-Module/reading-settings.md)
10 | 3. [Custom fields](/Setting-Module/custom-fields.md)
11 |
12 |
13 | ***
14 |
15 | [Back to ToC](../readme.md)
--------------------------------------------------------------------------------
/v1/setting-module/custom-fields.md:
--------------------------------------------------------------------------------
1 | title: Custom fields
2 | subtitle: Setting Module
3 | -------
4 |
5 | - [Custom Fields](#custom-fields)
6 |
7 | ## Setting module : Custom fields
8 |
9 | If you have a need for a custom field like a calendar for instance, you can specify the complete path in the `view:` key.
10 |
11 | For instance your module might make a calendar field available:
12 |
13 | ``` .language-php
14 | 'this-is-a-calendar' => [
15 | 'description' => 'This is a radio',
16 | 'view' => 'Module::admin.fields.calendar'
17 | ],
18 |
19 | ```
20 |
21 | This will override the basic available fields and use yours.
22 |
--------------------------------------------------------------------------------
/v2/setting-module/custom-fields.md:
--------------------------------------------------------------------------------
1 | title: Custom fields
2 | subtitle: Setting Module
3 | -------
4 |
5 | - [Custom Fields](#custom-fields)
6 |
7 | ## Setting module : Custom fields
8 |
9 | If you have a need for a custom field like a calendar for instance, you can specify the complete path in the `view:` key.
10 |
11 | For instance your module might make a calendar field available:
12 |
13 | ``` .language-php
14 | 'this-is-a-calendar' => [
15 | 'description' => 'This is a radio',
16 | 'view' => 'Module::admin.fields.calendar'
17 | ],
18 |
19 | ```
20 |
21 | This will override the basic available fields and use yours.
22 |
--------------------------------------------------------------------------------
/v3/setting-module/custom-fields.md:
--------------------------------------------------------------------------------
1 | title: Custom fields
2 | subtitle: Setting Module
3 | -------
4 |
5 | - [Custom Fields](#custom-fields)
6 |
7 | ## Setting module : Custom fields
8 |
9 | If you have a need for a custom field like a calendar for instance, you can specify the complete path in the `view:` key.
10 |
11 | For instance your module might make a calendar field available:
12 |
13 | ``` .language-php
14 | 'this-is-a-calendar' => [
15 | 'description' => 'This is a radio',
16 | 'view' => 'Module::admin.fields.calendar'
17 | ],
18 |
19 | ```
20 |
21 | This will override the basic available fields and use yours.
22 |
--------------------------------------------------------------------------------
/v4/setting-module/custom-fields.md:
--------------------------------------------------------------------------------
1 | title: Custom fields
2 | subtitle: Setting Module
3 | -------
4 |
5 | - [Custom Fields](#custom-fields)
6 |
7 | ## Setting module : Custom fields
8 |
9 | If you have a need for a custom field like a calendar for instance, you can specify the complete path in the `view:` key.
10 |
11 | For instance your module might make a calendar field available:
12 |
13 | ``` .language-php
14 | 'this-is-a-calendar' => [
15 | 'description' => 'This is a radio',
16 | 'view' => 'Module::admin.fields.calendar'
17 | ],
18 |
19 | ```
20 |
21 | This will override the basic available fields and use yours.
22 |
--------------------------------------------------------------------------------
/v1/media-module/refreshing-thumbnails.md:
--------------------------------------------------------------------------------
1 | title: Refreshing thumbnails
2 | subtitle: Media Module
3 | -------
4 |
5 | - [Refresh thumbnail command](#refresh-thumbnail-command)
6 |
7 | It is important you define your thumbnail with filters configuration before uploading any pictures. If you added new thumbnails or changed some thumbnail filters, after some media has already been uploaded you can run a refresh command to regenerate all thumbnails.
8 |
9 | ### Refresh thumbnail command
10 |
11 | The following command will refresh all thumbnails:
12 |
13 | ``` .language-bash
14 | php artisan asgard:media:refresh
15 | ```
16 |
--------------------------------------------------------------------------------
/v1/menu-module/managing-menus.md:
--------------------------------------------------------------------------------
1 | title: Managing menus
2 | subtitle: Menu Module
3 | -------
4 |
5 | ## Menus explained
6 |
7 | Menus in AsgardCMS are used like in any other site, to have a series of links available somewhere on your front-end layout. You can have as many menus as you want, a top-menu, a main menu, footer menu and so on.
8 | Each menu can have multiple **menuitems**. A menuitem can be linked to a specific URI, URL or a page.
9 |
10 | If you select Page, that page will be displayed when hitting the requested URI. You can also define per menu item if the link needs to be opened in the same page (*target = _self*) or a new one (*target = _blank*).
11 |
12 |
--------------------------------------------------------------------------------
/v2/menu-module/managing-menus.md:
--------------------------------------------------------------------------------
1 | title: Managing menus
2 | subtitle: Menu Module
3 | -------
4 |
5 | ## Menus explained
6 |
7 | Menus in AsgardCMS are used like in any other site, to have a series of links available somewhere on your front-end layout. You can have as many menus as you want, a top-menu, a main menu, footer menu and so on.
8 | Each menu can have multiple **menuitems**. A menuitem can be linked to a specific URI, URL or a page.
9 |
10 | If you select Page, that page will be displayed when hitting the requested URI. You can also define per menu item if the link needs to be opened in the same page (*target = _self*) or a new one (*target = _blank*).
11 |
12 |
--------------------------------------------------------------------------------
/v3/menu-module/managing-menus.md:
--------------------------------------------------------------------------------
1 | title: Managing menus
2 | subtitle: Menu Module
3 | -------
4 |
5 | ## Menus explained
6 |
7 | Menus in AsgardCMS are used like in any other site, to have a series of links available somewhere on your front-end layout. You can have as many menus as you want, a top-menu, a main menu, footer menu and so on.
8 | Each menu can have multiple **menuitems**. A menuitem can be linked to a specific URI, URL or a page.
9 |
10 | If you select Page, that page will be displayed when hitting the requested URI. You can also define per menu item if the link needs to be opened in the same page (*target = _self*) or a new one (*target = _blank*).
11 |
12 |
--------------------------------------------------------------------------------
/v4/menu-module/managing-menus.md:
--------------------------------------------------------------------------------
1 | title: Managing menus
2 | subtitle: Menu Module
3 | -------
4 |
5 | ## Menus explained
6 |
7 | Menus in AsgardCMS are used like in any other site, to have a series of links available somewhere on your front-end layout. You can have as many menus as you want, a top-menu, a main menu, footer menu and so on.
8 | Each menu can have multiple **menuitems**. A menuitem can be linked to a specific URI, URL or a page.
9 |
10 | If you select Page, that page will be displayed when hitting the requested URI. You can also define per menu item if the link needs to be opened in the same page (*target = _self*) or a new one (*target = _blank*).
11 |
12 |
--------------------------------------------------------------------------------
/v3/upgrade-guides/user.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: User module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 | ## From v2 to **v3**
9 |
10 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/User/changelog.yml)**
11 |
12 | **Relations closure change**
13 |
14 | If you used the dynamic relations configuration option in the user config file, please update `$self` to `$this` keyword. `$this` is now correctly bound inside the closure.
15 |
16 | **Auth:: facade now works with AsgardCMS**
17 |
18 | Feel free to use any of the laravel Authentication helpers. Like the `Auth::` facade but also the `@auth` or `@guest`.
19 |
20 | **Sidebar: User menu item weight**
21 |
22 | The user menu item weight has been changed to `10`.
23 |
--------------------------------------------------------------------------------
/v4/upgrade-guides/user.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: User module
3 | -------
4 |
5 | - [From v2 to v3](#upgrade-3.0)
6 |
7 |
8 | ## From v2 to **v3**
9 |
10 | **[> Changelog](https://github.com/AsgardCms/Platform/blob/3.0/Modules/User/changelog.yml)**
11 |
12 | **Relations closure change**
13 |
14 | If you used the dynamic relations configuration option in the user config file, please update `$self` to `$this` keyword. `$this` is now correctly bound inside the closure.
15 |
16 | **Auth:: facade now works with AsgardCMS**
17 |
18 | Feel free to use any of the laravel Authentication helpers. Like the `Auth::` facade but also the `@auth` or `@guest`.
19 |
20 | **Sidebar: User menu item weight**
21 |
22 | The user menu item weight has been changed to `10`.
23 |
--------------------------------------------------------------------------------
/v1/core-module/helpers.md:
--------------------------------------------------------------------------------
1 | title: Helpers
2 | subtitle: Core Module
3 | -------
4 |
5 | - [on_route](#on_route)
6 | - [locale](#locale)
7 |
8 | ### On route
9 |
10 | The `on_route()` helper function is pretty straightforward, it allows you to quickly check if the user is on the given route. This is usually used for setting active classes on a menu.
11 |
12 | Example usage:
13 |
14 | ``` .language-php
15 |
16 | Account
17 |
18 | ```
19 |
20 |
21 | ### Locale
22 |
23 | The `locale()` helper function is used to **get the current active locale** on the application.
24 |
25 | An optional argument can be given to **set the application locale**.
26 |
27 |
--------------------------------------------------------------------------------
/v1/setting-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: Setting Module
3 | -------
4 |
5 | The following events are triggered in the Setting Module:
6 |
7 | - [SettingWasCreated](#setting-was-created)
8 | - [SettingWasUpdate](#setting-was-updated)
9 |
10 |
11 | ### SettingWasCreated
12 |
13 | Triggered when a setting that wasn't already present in the settings table has been created. You have access to the setting **name** (*string*), whether it is **translatable** (*bool*) and its **values** (*array|string*).
14 |
15 |
16 | ### SettingWasUpdated
17 |
18 |
19 | Triggered when a setting was updated. You have access to the setting **name**, whether it is **translatable** (*bool*), its **values** (*array|string*) (*string*) and the **old values** (*array|string*).
--------------------------------------------------------------------------------
/v2/setting-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: Setting Module
3 | -------
4 |
5 | The following events are triggered in the Setting Module:
6 |
7 | - [SettingWasCreated](#setting-was-created)
8 | - [SettingWasUpdated](#setting-was-updated)
9 |
10 |
11 | ## SettingWasCreated
12 |
13 | Triggered when a setting that wasn't already present in the settings table has been created. You have access to the setting **name** (*string*), whether it is **translatable** (*bool*) and its **values** (*array|string*).
14 |
15 |
16 | ## SettingWasUpdated
17 |
18 |
19 | Triggered when a setting was updated. You have access to the setting **name**, whether it is **translatable** (*bool*), its **values** (*array|string*) (*string*) and the **old values** (*array|string*).
20 |
--------------------------------------------------------------------------------
/v3/setting-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: Setting Module
3 | -------
4 |
5 | The following events are triggered in the Setting Module:
6 |
7 | - [SettingWasCreated](#setting-was-created)
8 | - [SettingWasUpdated](#setting-was-updated)
9 |
10 |
11 | ## SettingWasCreated
12 |
13 | Triggered when a setting that wasn't already present in the settings table has been created. You have access to the setting **name** (*string*), whether it is **translatable** (*bool*) and its **values** (*array|string*).
14 |
15 |
16 | ## SettingWasUpdated
17 |
18 |
19 | Triggered when a setting was updated. You have access to the setting **name**, whether it is **translatable** (*bool*), its **values** (*array|string*) (*string*) and the **old values** (*array|string*).
20 |
--------------------------------------------------------------------------------
/v4/setting-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: Setting Module
3 | -------
4 |
5 | The following events are triggered in the Setting Module:
6 |
7 | - [SettingWasCreated](#setting-was-created)
8 | - [SettingWasUpdated](#setting-was-updated)
9 |
10 |
11 | ## SettingWasCreated
12 |
13 | Triggered when a setting that wasn't already present in the settings table has been created. You have access to the setting **name** (*string*), whether it is **translatable** (*bool*) and its **values** (*array|string*).
14 |
15 |
16 | ## SettingWasUpdated
17 |
18 |
19 | Triggered when a setting was updated. You have access to the setting **name**, whether it is **translatable** (*bool*), its **values** (*array|string*) (*string*) and the **old values** (*array|string*).
20 |
--------------------------------------------------------------------------------
/v2/upgrade-guides/menu.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Menu module
3 | -------
4 |
5 | - [From v1 to v2](#upgrade-2.0)
6 | - [From 1.13.0 to 1.14.0](#upgrade-1.14.0)
7 |
8 |
9 | ## From v1 to **v2**
10 |
11 | **[> Changelog](https://github.com/AsgardCms/Menu/blob/2.0/changelog.yml)**
12 |
13 | No breaking changes.
14 |
15 |
16 | ## From 1.13.0 to **1.14.0**
17 |
18 | **Translations have been removed**
19 |
20 | All translations files were removed from the individual modules and moved to the [Translation](https://github.com/AsgardCms/Translation) module. Therefore you will need to require the Translation module in your project. This can be done by running the following command in your project:
21 |
22 | ``` .language-bash
23 | composer require asgardcms/translation-module
24 | ```
25 |
26 |
--------------------------------------------------------------------------------
/v2/upgrade-guides/workshop.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Workshop module
3 | -------
4 |
5 | - [From v1 to v2](#upgrade-2.0)
6 | - [From 1.11.0 to 1.12.0](#upgrade-1.12.0)
7 |
8 |
9 |
10 | ## From v1 to **v2**
11 |
12 | **[> Changelog](https://github.com/AsgardCms/Workshop/blob/2.0/changelog.yml)**
13 |
14 | No breaking changes.
15 |
16 | ## From 1.11.0 to **1.12.0**
17 |
18 | **Translations have been removed**
19 |
20 | All translations files were removed from the individual modules and moved to the [Translation](https://github.com/AsgardCms/Translation) module. Therefore you will need to require the Translation module in your project. This can be done by running the following command in your project:
21 |
22 | ``` .language-bash
23 | composer require asgardcms/translation-module
24 | ```
25 |
--------------------------------------------------------------------------------
/v2/upgrade-guides/setting.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Setting module
3 | -------
4 |
5 | - [From v1 to v2](#upgrade-2.0)
6 | - [From 1.12.1 to 1.13.0](#upgrade-1.13.0)
7 |
8 |
9 |
10 | ## From v1 to **v2**
11 |
12 | **[> Changelog](https://github.com/AsgardCms/Setting/blob/2.0/changelog.yml)**
13 |
14 | No breaking changes.
15 |
16 |
17 | ## From 1.12.1 to **1.13.0**
18 |
19 | **Translations have been removed**
20 |
21 | All translations files were removed from the individual modules and moved to the [Translation](https://github.com/AsgardCms/Translation) module. Therefore you will need to require the Translation module in your project. This can be done by running the following command in your project:
22 |
23 | ``` .language-bash
24 | composer require asgardcms/translation-module
25 | ```
26 |
27 |
--------------------------------------------------------------------------------
/v2/menu-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: Menu Module
3 | -------
4 |
5 | The following events are triggered in the Menu Module:
6 |
7 | - [MenuWasCreated](#menu-was-created)
8 | - [MenuWasUpdated](#menu-was-updated)
9 | - [MenuItemWasCreated](#menu-item-was-created)
10 | - [MenuItemWasUpdated](#menu-item-was-updated)
11 |
12 | ## MenuWasCreated
13 |
14 | Triggered when a menu was created. You have access to the Menu entity.
15 |
16 | ## MenuWasUpdated
17 |
18 | Triggered when a menu was updated. You have access to the Menu entity.
19 |
20 | ## MenuItemWasCreated
21 |
22 | Triggered when a menu item was created. You have access to the Menu Item entity.
23 |
24 | ## MenuItemWasUpdated
25 |
26 | Triggered when a menu item was updated. You have access to the Menu Item entity.
27 |
--------------------------------------------------------------------------------
/v3/menu-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: Menu Module
3 | -------
4 |
5 | The following events are triggered in the Menu Module:
6 |
7 | - [MenuWasCreated](#menu-was-created)
8 | - [MenuWasUpdated](#menu-was-updated)
9 | - [MenuItemWasCreated](#menu-item-was-created)
10 | - [MenuItemWasUpdated](#menu-item-was-updated)
11 |
12 | ## MenuWasCreated
13 |
14 | Triggered when a menu was created. You have access to the Menu entity.
15 |
16 | ## MenuWasUpdated
17 |
18 | Triggered when a menu was updated. You have access to the Menu entity.
19 |
20 | ## MenuItemWasCreated
21 |
22 | Triggered when a menu item was created. You have access to the Menu Item entity.
23 |
24 | ## MenuItemWasUpdated
25 |
26 | Triggered when a menu item was updated. You have access to the Menu Item entity.
27 |
--------------------------------------------------------------------------------
/v4/menu-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: Menu Module
3 | -------
4 |
5 | The following events are triggered in the Menu Module:
6 |
7 | - [MenuWasCreated](#menu-was-created)
8 | - [MenuWasUpdated](#menu-was-updated)
9 | - [MenuItemWasCreated](#menu-item-was-created)
10 | - [MenuItemWasUpdated](#menu-item-was-updated)
11 |
12 | ## MenuWasCreated
13 |
14 | Triggered when a menu was created. You have access to the Menu entity.
15 |
16 | ## MenuWasUpdated
17 |
18 | Triggered when a menu was updated. You have access to the Menu entity.
19 |
20 | ## MenuItemWasCreated
21 |
22 | Triggered when a menu item was created. You have access to the Menu Item entity.
23 |
24 | ## MenuItemWasUpdated
25 |
26 | Triggered when a menu item was updated. You have access to the Menu Item entity.
27 |
--------------------------------------------------------------------------------
/v2/core-module/helpers.md:
--------------------------------------------------------------------------------
1 | title: Helpers
2 | subtitle: Core Module
3 | -------
4 |
5 | - [on_route](#on_route)
6 | - [locale](#locale)
7 | - [Is module enabled](#is_module_enabled)
8 |
9 | ## On route
10 |
11 | The `on_route()` helper function is pretty straightforward, it allows you to quickly check if the user is on the given route. This is usually used for setting active classes on a menu.
12 |
13 | Example usage:
14 |
15 | ``` .language-php
16 |
17 | Account
18 |
19 | ```
20 |
21 |
22 | ## Locale
23 |
24 | The `locale()` helper function is used to **get the current active locale** on the application.
25 |
26 | An optional argument can be given to **set the application locale**.
27 |
28 | ## Is module enabled
29 |
30 | The `is_module_enabled($moduleName)` functions returns `true` if the given module name is enabled or `false` if not.
--------------------------------------------------------------------------------
/v3/core-module/helpers.md:
--------------------------------------------------------------------------------
1 | title: Helpers
2 | subtitle: Core Module
3 | -------
4 |
5 | - [on_route](#on_route)
6 | - [locale](#locale)
7 | - [Is module enabled](#is_module_enabled)
8 |
9 | ## On route
10 |
11 | The `on_route()` helper function is pretty straightforward, it allows you to quickly check if the user is on the given route. This is usually used for setting active classes on a menu.
12 |
13 | Example usage:
14 |
15 | ``` .language-php
16 |
17 | Account
18 |
19 | ```
20 |
21 |
22 | ## Locale
23 |
24 | The `locale()` helper function is used to **get the current active locale** on the application.
25 |
26 | An optional argument can be given to **set the application locale**.
27 |
28 | ## Is module enabled
29 |
30 | The `is_module_enabled($moduleName)` functions returns `true` if the given module name is enabled or `false` if not.
--------------------------------------------------------------------------------
/v4/core-module/helpers.md:
--------------------------------------------------------------------------------
1 | title: Helpers
2 | subtitle: Core Module
3 | -------
4 |
5 | - [on_route](#on_route)
6 | - [locale](#locale)
7 | - [Is module enabled](#is_module_enabled)
8 |
9 | ## On route
10 |
11 | The `on_route()` helper function is pretty straightforward, it allows you to quickly check if the user is on the given route. This is usually used for setting active classes on a menu.
12 |
13 | Example usage:
14 |
15 | ``` .language-php
16 |
17 | Account
18 |
19 | ```
20 |
21 |
22 | ## Locale
23 |
24 | The `locale()` helper function is used to **get the current active locale** on the application.
25 |
26 | An optional argument can be given to **set the application locale**.
27 |
28 | ## Is module enabled
29 |
30 | The `is_module_enabled($moduleName)` functions returns `true` if the given module name is enabled or `false` if not.
--------------------------------------------------------------------------------
/v1/upgrade-guides/page.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Setting module
3 | -------
4 |
5 | - [From 1.11.0 to 1.12.0](#upgrade-1.12.0)
6 | - [From 1.10.0 to 1.11.0](#upgrade-1.11.0)
7 |
8 |
9 | ## From 1.11.0 to **1.12.0**
10 |
11 | **New Page configuration**
12 |
13 | A new configuration file has been added for the page module. You can publish it by running the following commnand:
14 |
15 | ``` .language-bash
16 | php artisan vendor:publish --provider="Modules\Page\Providers\PageServiceProvider" --force --tag="config"
17 | ```
18 |
19 | ## From 1.10.0 to **1.11.0**
20 |
21 | **Translations have been removed**
22 |
23 | All translations files were removed from the individual modules and moved to the [Translation](https://github.com/AsgardCms/Translation) module. Therefore you will need to require the Translation module in your project. This can be done by running the following command in your project:
24 |
25 | ``` .language-bash
26 | composer require asgardcms/translation-module
27 | ```
28 |
29 |
--------------------------------------------------------------------------------
/v1/media-module/getting-a-thumbnail.md:
--------------------------------------------------------------------------------
1 | title: Getting thumbnails
2 | subtitle: Media Module
3 | -------
4 |
5 | - [Injection](#injection)
6 | - [Facade](#facade)
7 |
8 | ## Media Module: Getting a thumbnail
9 |
10 | If you want to get a specific thumbnail of an image you can have 2 choices. Either you're in a view, then you'll use the Facade, if not use class/method injection.
11 |
12 | ### Injection
13 |
14 | ``` .language-php
15 | /**
16 | * @var Imagy
17 | */
18 | private $imagy;
19 |
20 | public function __construct(Imagy $imagy)
21 | {
22 | $this->imagy = $imagy;
23 | }
24 |
25 | public function index()
26 | {
27 | $thumbnail = $this->imagy->getThumbnail('/assets/media/original-image-name.png', 'smallThumb');
28 | }
29 | ```
30 |
31 |
32 | ### Facade
33 |
34 | In views, you can use the facade for ease of use. Simply send as first argument which image you want and which thumbnail:
35 |
36 | ``` .language-markup
37 |
38 | ```
39 |
40 |
--------------------------------------------------------------------------------
/v2/tag-module/tag-hooks.md:
--------------------------------------------------------------------------------
1 | title: Tag Hooks
2 | subtitle: Tag Module
3 | -------
4 |
5 | The tag module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [TagIsCreating](#tag-is-creating)
8 | - [TagIsUpdating](#tag-is-updating)
9 |
10 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
11 |
12 |
13 | ## TagIsCreating
14 |
15 |
16 | ## TagIsUpdating
17 |
18 | The `UserIsUpdating` has one more method:
19 |
20 | - `getTag()`: Will return the tag being updated
21 |
22 |
23 | ### TagIsCreating Example
24 |
25 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
26 |
27 | Lets say we want to uppercase our tag:
28 |
29 | ```.language-php
30 | Event::listen(TagIsCreating::class, function (TagIsCreating $event) {
31 | $event->setAttributes(['en' => ['name' => ucfirst($event->getAttribute('en.name'))]);
32 | });
33 | ```
34 |
--------------------------------------------------------------------------------
/v3/tag-module/tag-hooks.md:
--------------------------------------------------------------------------------
1 | title: Tag Hooks
2 | subtitle: Tag Module
3 | -------
4 |
5 | The tag module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [TagIsCreating](#tag-is-creating)
8 | - [TagIsUpdating](#tag-is-updating)
9 |
10 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
11 |
12 |
13 | ## TagIsCreating
14 |
15 |
16 | ## TagIsUpdating
17 |
18 | The `UserIsUpdating` has one more method:
19 |
20 | - `getTag()`: Will return the tag being updated
21 |
22 |
23 | ### TagIsCreating Example
24 |
25 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
26 |
27 | Lets say we want to uppercase our tag:
28 |
29 | ```.language-php
30 | Event::listen(TagIsCreating::class, function (TagIsCreating $event) {
31 | $event->setAttributes(['en' => ['name' => ucfirst($event->getAttribute('en.name'))]);
32 | });
33 | ```
34 |
--------------------------------------------------------------------------------
/v4/tag-module/tag-hooks.md:
--------------------------------------------------------------------------------
1 | title: Tag Hooks
2 | subtitle: Tag Module
3 | -------
4 |
5 | The tag module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [TagIsCreating](#tag-is-creating)
8 | - [TagIsUpdating](#tag-is-updating)
9 |
10 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
11 |
12 |
13 | ## TagIsCreating
14 |
15 |
16 | ## TagIsUpdating
17 |
18 | The `UserIsUpdating` has one more method:
19 |
20 | - `getTag()`: Will return the tag being updated
21 |
22 |
23 | ### TagIsCreating Example
24 |
25 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
26 |
27 | Lets say we want to uppercase our tag:
28 |
29 | ```.language-php
30 | Event::listen(TagIsCreating::class, function (TagIsCreating $event) {
31 | $event->setAttributes(['en' => ['name' => ucfirst($event->getAttribute('en.name'))]);
32 | });
33 | ```
34 |
--------------------------------------------------------------------------------
/v2/media-module/media-hooks.md:
--------------------------------------------------------------------------------
1 | title: Media Hooks
2 | subtitle: Media Module
3 | -------
4 |
5 | The media module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [FileIsCreating](#file-is-creating)
8 | - [FileIsUpdating](#file-is-updating)
9 |
10 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
11 |
12 |
13 | ## FileIsCreating
14 |
15 |
16 | ## FileIsUpdating
17 |
18 | The `FileIsUpdating` has one more method:
19 |
20 | - `getFile()`: Will return the file being updated
21 |
22 |
23 | ### FileIsCreating Example
24 |
25 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
26 |
27 | Lets force a lowercase filename:
28 |
29 | ```.language-php
30 | Event::listen(FileIsCreating::class, function (FileIsCreating $event) {
31 | $event->setAttributes(['filename' => strtolower($event->getAttribute('filename'))]);
32 | });
33 | ```
34 |
--------------------------------------------------------------------------------
/v3/media-module/media-hooks.md:
--------------------------------------------------------------------------------
1 | title: Media Hooks
2 | subtitle: Media Module
3 | -------
4 |
5 | The media module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [FileIsCreating](#file-is-creating)
8 | - [FileIsUpdating](#file-is-updating)
9 |
10 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
11 |
12 |
13 | ## FileIsCreating
14 |
15 |
16 | ## FileIsUpdating
17 |
18 | The `FileIsUpdating` has one more method:
19 |
20 | - `getFile()`: Will return the file being updated
21 |
22 |
23 | ### FileIsCreating Example
24 |
25 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
26 |
27 | Lets force a lowercase filename:
28 |
29 | ```.language-php
30 | Event::listen(FileIsCreating::class, function (FileIsCreating $event) {
31 | $event->setAttributes(['filename' => strtolower($event->getAttribute('filename'))]);
32 | });
33 | ```
34 |
--------------------------------------------------------------------------------
/v4/media-module/media-hooks.md:
--------------------------------------------------------------------------------
1 | title: Media Hooks
2 | subtitle: Media Module
3 | -------
4 |
5 | The media module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [FileIsCreating](#file-is-creating)
8 | - [FileIsUpdating](#file-is-updating)
9 |
10 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
11 |
12 |
13 | ## FileIsCreating
14 |
15 |
16 | ## FileIsUpdating
17 |
18 | The `FileIsUpdating` has one more method:
19 |
20 | - `getFile()`: Will return the file being updated
21 |
22 |
23 | ### FileIsCreating Example
24 |
25 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
26 |
27 | Lets force a lowercase filename:
28 |
29 | ```.language-php
30 | Event::listen(FileIsCreating::class, function (FileIsCreating $event) {
31 | $event->setAttributes(['filename' => strtolower($event->getAttribute('filename'))]);
32 | });
33 | ```
34 |
--------------------------------------------------------------------------------
/v2/setting-module/available-fields.md:
--------------------------------------------------------------------------------
1 | title: Available fields
2 | subtitle: Setting Module
3 | -------
4 |
5 | - [Available fields](#available-fields)
6 |
7 | ## Available fields
8 |
9 | The setting module has the basic input fields available for you. These fields are available both for translatable fields as plain fields.
10 |
11 | - input type text
12 |
13 | ``` .language-markup
14 | text
15 | ```
16 | - input checkbox
17 |
18 | ``` .language-markup
19 | checkbox
20 | ```
21 | - textarea
22 |
23 | ``` .language-markup
24 | textarea
25 | ```
26 | - input radio
27 |
28 | ``` .language-markup
29 | radio
30 | ```
31 | The Radio field needs an additional `options` key with the wanted options. For instance:
32 |
33 | ``` .language-php
34 | 'this-is-a-radio' => [
35 | 'description' => 'This is a radio',
36 | 'options' => [
37 | 'option1' => 'Option 1',
38 | 'option2' => 'Option 2',
39 | 'option3' => 'Option 3',
40 | ],
41 | 'view' => 'radio'
42 | ],
43 | ```
44 | - input number
45 |
46 | ``` .language-markup
47 | number
48 | ```
49 |
50 |
--------------------------------------------------------------------------------
/v3/setting-module/available-fields.md:
--------------------------------------------------------------------------------
1 | title: Available fields
2 | subtitle: Setting Module
3 | -------
4 |
5 | - [Available fields](#available-fields)
6 |
7 | ## Available fields
8 |
9 | The setting module has the basic input fields available for you. These fields are available both for translatable fields as plain fields.
10 |
11 | - input type text
12 |
13 | ``` .language-markup
14 | text
15 | ```
16 | - input checkbox
17 |
18 | ``` .language-markup
19 | checkbox
20 | ```
21 | - textarea
22 |
23 | ``` .language-markup
24 | textarea
25 | ```
26 | - input radio
27 |
28 | ``` .language-markup
29 | radio
30 | ```
31 | The Radio field needs an additional `options` key with the wanted options. For instance:
32 |
33 | ``` .language-php
34 | 'this-is-a-radio' => [
35 | 'description' => 'This is a radio',
36 | 'options' => [
37 | 'option1' => 'Option 1',
38 | 'option2' => 'Option 2',
39 | 'option3' => 'Option 3',
40 | ],
41 | 'view' => 'radio'
42 | ],
43 | ```
44 | - input number
45 |
46 | ``` .language-markup
47 | number
48 | ```
49 |
50 |
--------------------------------------------------------------------------------
/v4/setting-module/available-fields.md:
--------------------------------------------------------------------------------
1 | title: Available fields
2 | subtitle: Setting Module
3 | -------
4 |
5 | - [Available fields](#available-fields)
6 |
7 | ## Available fields
8 |
9 | The setting module has the basic input fields available for you. These fields are available both for translatable fields as plain fields.
10 |
11 | - input type text
12 |
13 | ``` .language-markup
14 | text
15 | ```
16 | - input checkbox
17 |
18 | ``` .language-markup
19 | checkbox
20 | ```
21 | - textarea
22 |
23 | ``` .language-markup
24 | textarea
25 | ```
26 | - input radio
27 |
28 | ``` .language-markup
29 | radio
30 | ```
31 | The Radio field needs an additional `options` key with the wanted options. For instance:
32 |
33 | ``` .language-php
34 | 'this-is-a-radio' => [
35 | 'description' => 'This is a radio',
36 | 'options' => [
37 | 'option1' => 'Option 1',
38 | 'option2' => 'Option 2',
39 | 'option3' => 'Option 3',
40 | ],
41 | 'view' => 'radio'
42 | ],
43 | ```
44 | - input number
45 |
46 | ``` .language-markup
47 | number
48 | ```
49 |
50 |
--------------------------------------------------------------------------------
/v1/setting-module/available-fields.md:
--------------------------------------------------------------------------------
1 | title: Available fields
2 | subtitle: Setting Module
3 | -------
4 |
5 | - [Available fields](#available-fields)
6 |
7 | ### Available fields
8 |
9 | The setting module has the basic input fields available for you. These fields are available both for translatable fields as plain fields.
10 |
11 | - input type text
12 |
13 | ``` .language-markup
14 | text
15 | ```
16 | - input checkbox
17 |
18 | ``` .language-markup
19 | checkbox
20 | ```
21 | - textarea
22 |
23 | ``` .language-markup
24 | textarea
25 | ```
26 | - input radio
27 |
28 | ``` .language-markup
29 | radio
30 | ```
31 | The Radio field needs an additional `options` key with the wanted options. For instance:
32 |
33 | ``` .language-php
34 | 'this-is-a-radio' => [
35 | 'description' => 'This is a radio',
36 | 'options' => [
37 | 'option1' => 'Option 1',
38 | 'option2' => 'Option 2',
39 | 'option3' => 'Option 3',
40 | ],
41 | 'view' => 'radio'
42 | ],
43 | ```
44 | - input number
45 |
46 | ``` .language-markup
47 | number
48 | ```
49 |
50 |
--------------------------------------------------------------------------------
/v1/upgrade-guides/user.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: User module
3 | -------
4 |
5 | - [From 1.13.1 to 1.14.0](#upgrade-1.14.0)
6 | - [From 1.11.0 to 1.12.0](#upgrade-1.12.0)
7 |
8 | ## From 1.13.1 to **1.14.0**
9 |
10 | **Translations have been removed**
11 |
12 | All translations files were removed from the individual modules and moved to the [Translation](https://github.com/AsgardCms/Translation) module. Therefore you will need to require the Translation module in your project. This can be done by running the following command in your project:
13 |
14 | ``` .language-bash
15 | composer require asgardcms/translation-module
16 | ```
17 |
18 | ## From 1.11.0 to **1.12.0**
19 |
20 | **New authentication views**
21 |
22 | All authentication views were updated to the latest version of AdminLTE. If you were using the default authentication views and had them published, you will need to re-publish those views. This can be done with the following command:
23 |
24 | ``` .language-bash
25 | php artisan vendor:publish --provider="Modules\User\Providers\UserServiceProvider" --force
26 | ```
27 |
28 |
--------------------------------------------------------------------------------
/v1/user-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: User Module
3 | -------
4 |
5 | The following events are triggered in the User Module:
6 |
7 | - [UserHasRegistered](#user-has-registered)
8 | - [UserHasBegunResetProcess](#user-has-begon-reset-process)
9 | - [UserWasUpdated](#user-was-updated)
10 | - [RoleWasUpdated](#role-was-updated)
11 |
12 |
13 | ### UserHasRegistered
14 |
15 | Triggered when a user has registered. You have access to the complete User entity.
16 |
17 | ### UserHasBegunResetProcess
18 |
19 | Triggered when a user has begun the reset password process. You have access to the complete User entity and the reset code that was generated.
20 |
21 |
22 | ### UserWasUpdated
23 |
24 | Triggered when a user was updated in the administration. You have access to the complete User entity.
25 |
26 |
27 | ### RoleWasUpdated
28 |
29 | Triggered when a role was updated in the administration. You have access to the complete Role entity.
--------------------------------------------------------------------------------
/v1/media-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: Media Module
3 | -------
4 |
5 | The following events are triggered in the Media Module:
6 |
7 | - [FileWasUploaded](#file-was-uploaded)
8 | - [FileWasLinked](#file-was-linked)
9 | - [FileWasUnlinked](#file-was-unlinked)
10 |
11 |
12 | ### FileWasUploaded
13 |
14 | Triggered when a file was uploaded. You have access to the complete [File entity](https://github.com/AsgardCms/Media/blob/master/Entities/File.php).
15 |
16 | ### FileWasLinked
17 |
18 | Triggered when a file was linked to an other entity. You have access to the complete [File entity](https://github.com/AsgardCms/Media/blob/master/Entities/File.php) as well as the linked entity.
19 |
20 | For instance if you link a cover image to your blog post, you'll have access to the file and to the post the file was linked too.
21 |
22 | ### FileWasUnlinked
23 |
24 |
25 | Triggered when a file was unlinked from an entity. You have access to the imageable relation.
26 |
27 | In this relation you have access to the `file_id`, the `type`, `type_id` and the `zone`.
28 |
--------------------------------------------------------------------------------
/v1/user-module/middleware.md:
--------------------------------------------------------------------------------
1 | title: Middleware
2 | subtitle: User Module
3 | -------
4 |
5 | - [Guest middleware](#guest_middleware)
6 | - [Logged in middleware](#logged_in_middleware)
7 |
8 | ### Guest middleware
9 |
10 | The guest middleware makes sure the current route can't be accessed by a logged in user.
11 |
12 | By setting a route in the `redirect_route_after_login` config key in the `config/asgard.user.users.php` file, you can make the middleware redirect to your desired route. This defaults to `homepage`.
13 |
14 | Example usage:
15 |
16 | ``` .language-php
17 | $router->get('login', [
18 | 'middleware' => 'auth.guest',
19 | 'as' => 'login',
20 | 'uses' => 'AuthController@getLogin',
21 | ]);
22 | ```
23 |
24 | ### Logged in middleware
25 |
26 | The logged in middleware makes sure the current route can **only** be accessed by logged in users. This will redirect the user to the login page if it fails.
27 |
28 | Example usage:
29 |
30 | ``` .language-php
31 | $router->group(['middleware' => 'logged.in'], function (Router $router) {
32 | $router->get('account', [
33 | 'as' => 'user.account',
34 | 'uses' => 'Frontend\ProfileController@show',
35 | ]);
36 | });
37 | ```
--------------------------------------------------------------------------------
/v2/upgrade-guides/page.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Page module
3 | -------
4 |
5 | - [From v1 to v2](#upgrade-2.0)
6 | - [From 1.11.0 to 1.12.0](#upgrade-1.12.0)
7 | - [From 1.10.0 to 1.11.0](#upgrade-1.11.0)
8 |
9 |
10 | ## From v1 to **v2**
11 |
12 | **[> Changelog](https://github.com/AsgardCms/Page/blob/2.0/changelog.yml)**
13 |
14 | No breaking changes.
15 |
16 |
17 | ## From 1.11.0 to **1.12.0**
18 |
19 | **New Page configuration**
20 |
21 | A new configuration file has been added for the page module. You can publish it by running the following commnand:
22 |
23 | ``` .language-bash
24 | php artisan vendor:publish --provider="Modules\Page\Providers\PageServiceProvider" --force --tag="config"
25 | ```
26 |
27 | ## From 1.10.0 to **1.11.0**
28 |
29 | **Translations have been removed**
30 |
31 | All translations files were removed from the individual modules and moved to the [Translation](https://github.com/AsgardCms/Translation) module. Therefore you will need to require the Translation module in your project. This can be done by running the following command in your project:
32 |
33 | ``` .language-bash
34 | composer require asgardcms/translation-module
35 | ```
36 |
37 |
--------------------------------------------------------------------------------
/v1/core-module/configuration.md:
--------------------------------------------------------------------------------
1 | title: Configuration
2 | subtitle: Core Module
3 | -------
4 |
5 | - [Admin prefix](#admin-prefix)
6 | - [Admin theme](#admin-theme)
7 | - [AdminLTE skin](#adminlte-skin)
8 |
9 | This **Core Module** has one main configuration item, you'll find it at `config/asgard.core.core.php`.
10 |
11 | ## Admin Prefix
12 |
13 | With this configuration you can set how you access the admin dashboard. By default it is set to `backend`. Meaning you can access your admin dashboard on the following url `localhost:8000/backend` (if you're using the `artisan serve` command).
14 |
15 | ``` language-php
16 | 'admin-prefix' => 'backend'
17 | ```
18 |
19 |
20 | ## Admin theme
21 |
22 | With this setting you can change the theme used in the administration. Make sure your admin theme has the type set to `backend`.
23 |
24 | It defaults to `AdminLTE`.
25 |
26 |
27 | ``` .language-php
28 | 'admin-theme' => 'AdminLTE',
29 | ```
30 |
31 |
32 | ## AdminLTE skin
33 |
34 | You can customize the AdminLTE colors with this setting. The following colors are available for you to use:
35 |
36 | - skin-blue,
37 | - skin-green,
38 | - skin-black,
39 | - skin-purple,
40 | - skin-red,
41 | - skin-yellow.
42 |
43 | This defaults to the blue skin.
44 |
45 | ``` .language-php
46 | 'skin' => 'skin-blue',
47 | ```
48 |
49 |
--------------------------------------------------------------------------------
/v2/setting-module/setting-hooks.md:
--------------------------------------------------------------------------------
1 | title: Setting Hooks
2 | subtitle: Setting Module
3 | -------
4 |
5 | The setting module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [SettingIsCreating](#setting-is-creating)
8 | - [SettingIsUpdating](#setting-is-updating)
9 |
10 | ## SettingIsCreating
11 |
12 | These methods are available:
13 |
14 | - `getSettingName()`: will return the setting name
15 | - `getSettingValues()`: will return the setting value(s)
16 | - `setSettingValues($settingValues)`: set the value for the current setting
17 | - `getOriginal()`: get the original setting values
18 |
19 | ## SettingIsUpdating
20 |
21 | The `SettingIsUpdating` has one more method:
22 |
23 | - `getSetting()`: Will return the setting being updated
24 |
25 |
26 | ### SettingIsCreating Example
27 |
28 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
29 |
30 | Lets say we want to uppercase our `core::template` setting:
31 |
32 | ```.language-php
33 | Event::listen(SettingIsCreating::class, function (SettingIsCreating $event) {
34 | if ($event->getSettingName() === 'core::template') {
35 | $event->setSettingValues('my-template');
36 | }
37 | });
38 | ```
39 |
40 |
41 |
--------------------------------------------------------------------------------
/v3/setting-module/setting-hooks.md:
--------------------------------------------------------------------------------
1 | title: Setting Hooks
2 | subtitle: Setting Module
3 | -------
4 |
5 | The setting module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [SettingIsCreating](#setting-is-creating)
8 | - [SettingIsUpdating](#setting-is-updating)
9 |
10 | ## SettingIsCreating
11 |
12 | These methods are available:
13 |
14 | - `getSettingName()`: will return the setting name
15 | - `getSettingValues()`: will return the setting value(s)
16 | - `setSettingValues($settingValues)`: set the value for the current setting
17 | - `getOriginal()`: get the original setting values
18 |
19 | ## SettingIsUpdating
20 |
21 | The `SettingIsUpdating` has one more method:
22 |
23 | - `getSetting()`: Will return the setting being updated
24 |
25 |
26 | ### SettingIsCreating Example
27 |
28 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
29 |
30 | Lets say we want to uppercase our `core::template` setting:
31 |
32 | ```.language-php
33 | Event::listen(SettingIsCreating::class, function (SettingIsCreating $event) {
34 | if ($event->getSettingName() === 'core::template') {
35 | $event->setSettingValues('my-template');
36 | }
37 | });
38 | ```
39 |
40 |
41 |
--------------------------------------------------------------------------------
/v4/setting-module/setting-hooks.md:
--------------------------------------------------------------------------------
1 | title: Setting Hooks
2 | subtitle: Setting Module
3 | -------
4 |
5 | The setting module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [SettingIsCreating](#setting-is-creating)
8 | - [SettingIsUpdating](#setting-is-updating)
9 |
10 | ## SettingIsCreating
11 |
12 | These methods are available:
13 |
14 | - `getSettingName()`: will return the setting name
15 | - `getSettingValues()`: will return the setting value(s)
16 | - `setSettingValues($settingValues)`: set the value for the current setting
17 | - `getOriginal()`: get the original setting values
18 |
19 | ## SettingIsUpdating
20 |
21 | The `SettingIsUpdating` has one more method:
22 |
23 | - `getSetting()`: Will return the setting being updated
24 |
25 |
26 | ### SettingIsCreating Example
27 |
28 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
29 |
30 | Lets say we want to uppercase our `core::template` setting:
31 |
32 | ```.language-php
33 | Event::listen(SettingIsCreating::class, function (SettingIsCreating $event) {
34 | if ($event->getSettingName() === 'core::template') {
35 | $event->setSettingValues('my-template');
36 | }
37 | });
38 | ```
39 |
40 |
41 |
--------------------------------------------------------------------------------
/v2/workshop-module/theme-scaffold.md:
--------------------------------------------------------------------------------
1 | title: Create a theme
2 | subtitle: Workshop Module
3 | -------
4 |
5 | - [Introduction](#introduction)
6 | - [Usage](#usage)
7 | - [Manual creation](#manual-creation)
8 |
9 |
10 | ## Introduction
11 |
12 | The theme scaffolder is a command line tool that will give you the ability to generate themes in a matter of seconds.
13 |
14 | To have a quick idea on what it does you can check out [this quickcast](http://quick.as/epduvv4b).
15 |
16 | ## Usage
17 |
18 | The usage is pretty simple and straightforward. Simply call the following command from the project root:
19 |
20 | ``` .language-bash
21 | php artisan asgard:theme:scaffold
22 | ```
23 |
24 | You will be asked the following questions:
25 |
26 | - What is the theme name
27 |
28 | This is in the following format `vendor/name` all lowercase.
29 | - Do you wish to make a backend or front end theme ?
30 |
31 | And that's it. You'll find you newly created theme under the `Themes/` directory.
32 |
33 |
34 | ## Manual creation
35 |
36 | You can create themes manually as well, all a theme needs is the `theme.json` file to be registerable on the [Stylist package](https://github.com/floatingpointsoftware/stylist).
37 |
38 | After you created the `theme.json` file, run a `php artisan cache:clear`.
39 |
40 | > In both cases you will need to active the theme from the backend Settings page, "Front end template".
--------------------------------------------------------------------------------
/v3/workshop-module/theme-scaffold.md:
--------------------------------------------------------------------------------
1 | title: Create a theme
2 | subtitle: Workshop Module
3 | -------
4 |
5 | - [Introduction](#introduction)
6 | - [Usage](#usage)
7 | - [Manual creation](#manual-creation)
8 |
9 |
10 | ## Introduction
11 |
12 | The theme scaffolder is a command line tool that will give you the ability to generate themes in a matter of seconds.
13 |
14 | To have a quick idea on what it does you can check out [this quickcast](http://quick.as/epduvv4b).
15 |
16 | ## Usage
17 |
18 | The usage is pretty simple and straightforward. Simply call the following command from the project root:
19 |
20 | ``` .language-bash
21 | php artisan asgard:theme:scaffold
22 | ```
23 |
24 | You will be asked the following questions:
25 |
26 | - What is the theme name
27 |
28 | This is in the following format `vendor/name` all lowercase.
29 | - Do you wish to make a backend or front end theme ?
30 |
31 | And that's it. You'll find you newly created theme under the `Themes/` directory.
32 |
33 |
34 | ## Manual creation
35 |
36 | You can create themes manually as well, all a theme needs is the `theme.json` file to be registerable on the [Stylist package](https://github.com/floatingpointsoftware/stylist).
37 |
38 | After you created the `theme.json` file, run a `php artisan cache:clear`.
39 |
40 | > In both cases you will need to active the theme from the backend Settings page, "Front end template".
--------------------------------------------------------------------------------
/v4/workshop-module/theme-scaffold.md:
--------------------------------------------------------------------------------
1 | title: Create a theme
2 | subtitle: Workshop Module
3 | -------
4 |
5 | - [Introduction](#introduction)
6 | - [Usage](#usage)
7 | - [Manual creation](#manual-creation)
8 |
9 |
10 | ## Introduction
11 |
12 | The theme scaffolder is a command line tool that will give you the ability to generate themes in a matter of seconds.
13 |
14 | To have a quick idea on what it does you can check out [this quickcast](http://quick.as/epduvv4b).
15 |
16 | ## Usage
17 |
18 | The usage is pretty simple and straightforward. Simply call the following command from the project root:
19 |
20 | ``` .language-bash
21 | php artisan asgard:theme:scaffold
22 | ```
23 |
24 | You will be asked the following questions:
25 |
26 | - What is the theme name
27 |
28 | This is in the following format `vendor/name` all lowercase.
29 | - Do you wish to make a backend or front end theme ?
30 |
31 | And that's it. You'll find you newly created theme under the `Themes/` directory.
32 |
33 |
34 | ## Manual creation
35 |
36 | You can create themes manually as well, all a theme needs is the `theme.json` file to be registerable on the [Stylist package](https://github.com/floatingpointsoftware/stylist).
37 |
38 | After you created the `theme.json` file, run a `php artisan cache:clear`.
39 |
40 | > In both cases you will need to active the theme from the backend Settings page, "Front end template".
--------------------------------------------------------------------------------
/v1/workshop-module/theme-scaffold.md:
--------------------------------------------------------------------------------
1 | title: Create a theme
2 | subtitle: Workshop Module
3 | -------
4 |
5 | - [Introduction](#introduction)
6 | - [Usage](#usage)
7 | - [Manual creation](#manual-creation)
8 |
9 |
10 | ### Introduction
11 |
12 | The theme scaffolder is a command line tool that will give you the ability to generate themes in a matter of seconds.
13 |
14 | To have a quick idea on what it does you can check out [this quickcast](http://quick.as/epduvv4b).
15 |
16 | ### Usage
17 |
18 | The usage is pretty simple and straightforward. Simply call the following command from the project root:
19 |
20 | ``` .language-bash
21 | php artisan asgard:theme:scaffold
22 | ```
23 |
24 | You will be asked the following questions:
25 |
26 | - What is the theme name
27 |
28 | This is in the following format `vendor/name` all lowercase.
29 | - Do you wish to make a backend or front end theme ?
30 |
31 | And that's it. You'll find you newly created theme under the `Themes/` directory.
32 |
33 |
34 | ### Manual creation
35 |
36 | You can create themes manually as well, all a theme needs is the `theme.json` file to be registerable on the [Stylist package](https://github.com/floatingpointsoftware/stylist).
37 |
38 | After you created the `theme.json` file, run a `php artisan cache:clear`.
39 |
40 | > In both cases you will need to active the theme from the backend Settings page, "Front end template".
--------------------------------------------------------------------------------
/v2/core-module/repositories.md:
--------------------------------------------------------------------------------
1 | title: Repositories
2 | subtitle: Core Module
3 | -------
4 |
5 | - [Usage](#usage)
6 | - [Non translatable usage](#non_translatable_usage)
7 |
8 |
9 |
10 |
11 | ## Usage
12 |
13 |
14 | The core module has a [base repository](https://github.com/nWidart-Modules/Core/blob/master/Repositories/BaseRepository.php) and an abstract [Eloquent implementation](https://github.com/nWidart-Modules/Core/blob/master/Repositories/Eloquent/EloquentBaseRepository.php).
15 |
16 | Your repositories and its interfaces can extend those base class/interfaces for less code duplication.
17 |
18 | All you need to do to bind the interface to the implementation
19 | is something like the following:
20 |
21 |
22 | ``` .language-php
23 | $this->app->bind(PostRepository::class, function() {
24 | return new EloquentPostRepository(new Post);
25 | });
26 | ```
27 |
28 | Instead of passing a string as a second argument to your implementation class, you pass a closure with the implemented class with needs an instance of the model.
29 |
30 |
31 | ## Non translatable usage
32 |
33 |
34 | If your entity isn't translatable you'll have to overwrite the `all` and `find($id)` methods on your eloquent repository implementation:
35 |
36 | ``` .language-php
37 | public function find($id)
38 | {
39 | return $this->model->find($id);
40 | }
41 |
42 | public function all()
43 | {
44 | return $this->model->orderBy('created_at', 'DESC')->get();
45 | }
46 | ```
--------------------------------------------------------------------------------
/v3/core-module/repositories.md:
--------------------------------------------------------------------------------
1 | title: Repositories
2 | subtitle: Core Module
3 | -------
4 |
5 | - [Usage](#usage)
6 | - [Non translatable usage](#non_translatable_usage)
7 |
8 |
9 |
10 |
11 | ## Usage
12 |
13 |
14 | The core module has a [base repository](https://github.com/nWidart-Modules/Core/blob/master/Repositories/BaseRepository.php) and an abstract [Eloquent implementation](https://github.com/nWidart-Modules/Core/blob/master/Repositories/Eloquent/EloquentBaseRepository.php).
15 |
16 | Your repositories and its interfaces can extend those base class/interfaces for less code duplication.
17 |
18 | All you need to do to bind the interface to the implementation
19 | is something like the following:
20 |
21 |
22 | ``` .language-php
23 | $this->app->bind(PostRepository::class, function() {
24 | return new EloquentPostRepository(new Post);
25 | });
26 | ```
27 |
28 | Instead of passing a string as a second argument to your implementation class, you pass a closure with the implemented class with needs an instance of the model.
29 |
30 |
31 | ## Non translatable usage
32 |
33 |
34 | If your entity isn't translatable you'll have to overwrite the `all` and `find($id)` methods on your eloquent repository implementation:
35 |
36 | ``` .language-php
37 | public function find($id)
38 | {
39 | return $this->model->find($id);
40 | }
41 |
42 | public function all()
43 | {
44 | return $this->model->orderBy('created_at', 'DESC')->get();
45 | }
46 | ```
--------------------------------------------------------------------------------
/v4/core-module/repositories.md:
--------------------------------------------------------------------------------
1 | title: Repositories
2 | subtitle: Core Module
3 | -------
4 |
5 | - [Usage](#usage)
6 | - [Non translatable usage](#non_translatable_usage)
7 |
8 |
9 |
10 |
11 | ## Usage
12 |
13 |
14 | The core module has a [base repository](https://github.com/nWidart-Modules/Core/blob/master/Repositories/BaseRepository.php) and an abstract [Eloquent implementation](https://github.com/nWidart-Modules/Core/blob/master/Repositories/Eloquent/EloquentBaseRepository.php).
15 |
16 | Your repositories and its interfaces can extend those base class/interfaces for less code duplication.
17 |
18 | All you need to do to bind the interface to the implementation
19 | is something like the following:
20 |
21 |
22 | ``` .language-php
23 | $this->app->bind(PostRepository::class, function() {
24 | return new EloquentPostRepository(new Post);
25 | });
26 | ```
27 |
28 | Instead of passing a string as a second argument to your implementation class, you pass a closure with the implemented class with needs an instance of the model.
29 |
30 |
31 | ## Non translatable usage
32 |
33 |
34 | If your entity isn't translatable you'll have to overwrite the `all` and `find($id)` methods on your eloquent repository implementation:
35 |
36 | ``` .language-php
37 | public function find($id)
38 | {
39 | return $this->model->find($id);
40 | }
41 |
42 | public function all()
43 | {
44 | return $this->model->orderBy('created_at', 'DESC')->get();
45 | }
46 | ```
--------------------------------------------------------------------------------
/v1/core-module/repositories.md:
--------------------------------------------------------------------------------
1 | title: Repositories
2 | subtitle: Core Module
3 | -------
4 |
5 | - [Usage](#usage)
6 | - [Non translatable usage](#non_translatable_usage)
7 |
8 |
9 |
10 |
11 | ### Usage
12 |
13 |
14 | The core module has a [base repository](https://github.com/nWidart-Modules/Core/blob/master/Repositories/BaseRepository.php) and an abstract [Eloquent implementation](https://github.com/nWidart-Modules/Core/blob/master/Repositories/Eloquent/EloquentBaseRepository.php).
15 |
16 | Your repositories and its interfaces can extend those base class/interfaces for less code duplication.
17 |
18 | All you need to do to bind the interface to the implementation
19 | is something like the following:
20 |
21 |
22 | ``` .language-php
23 | $this->app->bind(
24 | 'Modules\Blog\Repositories\PostRepository',
25 | function() {
26 | return new EloquentPostRepository(new Post);
27 | }
28 | );
29 | ```
30 |
31 | Instead of passing a string as a second argument to your implementation class, you pass a closure with the implemented class with needs an instance of the model.
32 |
33 |
34 | ### Non translatable usage
35 |
36 |
37 | If your entity isn't translatable you'll have to overwrite the `all` and `find($id)` methods on your eloquent repository implementation:
38 |
39 | ``` .language-php
40 | public function find($id)
41 | {
42 | return $this->model->find($id);
43 | }
44 |
45 | public function all()
46 | {
47 | return $this->model->orderBy('created_at', 'DESC')->get();
48 | }
49 | ```
--------------------------------------------------------------------------------
/v2/menu-module/menu-hooks.md:
--------------------------------------------------------------------------------
1 | title: Menu Hooks
2 | subtitle: Menu Module
3 | -------
4 |
5 | The menu module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [MenuIsCreating](#menu-is-creating)
8 | - [MenuIsUpdating](#menu-is-updating)
9 | - [MenuItemIsCreating](#menu-item-is-creating)
10 | - [MenuItemIsUpdating](#menu-item-is-updating)
11 |
12 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
13 |
14 |
15 | ## MenuIsCreating
16 |
17 |
18 | ## MenuIsUpdating
19 |
20 | The `MenuIsUpdating` has one more method:
21 |
22 | - `getMenu()`: Will return the menu being updated
23 |
24 |
25 | ### MenuIsCreating Example
26 |
27 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
28 |
29 | Lets say you want to make the menu name lowercase:
30 |
31 | ```.language-php
32 | Event::listen(MenuIsCreating::class, function (MenuIsCreating $event) {
33 | $event->setAttributes(['name' => strtolower($event->getAttribute('name'))]);
34 | });
35 | ```
36 |
37 |
38 | ## MenuItemIsCreating
39 |
40 |
41 | ## MenuItemIsUpdating
42 |
43 | The `MenuItemIsUpdating` has one more method:
44 |
45 | - `getMenuItem()`: Will return the menu item being updated
46 |
47 |
--------------------------------------------------------------------------------
/v3/menu-module/menu-hooks.md:
--------------------------------------------------------------------------------
1 | title: Menu Hooks
2 | subtitle: Menu Module
3 | -------
4 |
5 | The menu module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [MenuIsCreating](#menu-is-creating)
8 | - [MenuIsUpdating](#menu-is-updating)
9 | - [MenuItemIsCreating](#menu-item-is-creating)
10 | - [MenuItemIsUpdating](#menu-item-is-updating)
11 |
12 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
13 |
14 |
15 | ## MenuIsCreating
16 |
17 |
18 | ## MenuIsUpdating
19 |
20 | The `MenuIsUpdating` has one more method:
21 |
22 | - `getMenu()`: Will return the menu being updated
23 |
24 |
25 | ### MenuIsCreating Example
26 |
27 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
28 |
29 | Lets say you want to make the menu name lowercase:
30 |
31 | ```.language-php
32 | Event::listen(MenuIsCreating::class, function (MenuIsCreating $event) {
33 | $event->setAttributes(['name' => strtolower($event->getAttribute('name'))]);
34 | });
35 | ```
36 |
37 |
38 | ## MenuItemIsCreating
39 |
40 |
41 | ## MenuItemIsUpdating
42 |
43 | The `MenuItemIsUpdating` has one more method:
44 |
45 | - `getMenuItem()`: Will return the menu item being updated
46 |
47 |
--------------------------------------------------------------------------------
/v4/menu-module/menu-hooks.md:
--------------------------------------------------------------------------------
1 | title: Menu Hooks
2 | subtitle: Menu Module
3 | -------
4 |
5 | The menu module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [MenuIsCreating](#menu-is-creating)
8 | - [MenuIsUpdating](#menu-is-updating)
9 | - [MenuItemIsCreating](#menu-item-is-creating)
10 | - [MenuItemIsUpdating](#menu-item-is-updating)
11 |
12 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
13 |
14 |
15 | ## MenuIsCreating
16 |
17 |
18 | ## MenuIsUpdating
19 |
20 | The `MenuIsUpdating` has one more method:
21 |
22 | - `getMenu()`: Will return the menu being updated
23 |
24 |
25 | ### MenuIsCreating Example
26 |
27 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
28 |
29 | Lets say you want to make the menu name lowercase:
30 |
31 | ```.language-php
32 | Event::listen(MenuIsCreating::class, function (MenuIsCreating $event) {
33 | $event->setAttributes(['name' => strtolower($event->getAttribute('name'))]);
34 | });
35 | ```
36 |
37 |
38 | ## MenuItemIsCreating
39 |
40 |
41 | ## MenuItemIsUpdating
42 |
43 | The `MenuItemIsUpdating` has one more method:
44 |
45 | - `getMenuItem()`: Will return the menu item being updated
46 |
47 |
--------------------------------------------------------------------------------
/v2/workshop-module/module-scaffold.md:
--------------------------------------------------------------------------------
1 | title: Create a module
2 | subtitle: Workshop Module
3 | -------
4 |
5 | - [Introduction](#introduction)
6 | - [Usage](#usage)
7 |
8 |
9 | ## Introduction
10 |
11 | The module scaffolder is a command line tool that will give you the ability to generate modules in a matter of seconds.
12 |
13 | To have a quick idea on what it does you can check out [this quickcast](http://quick.as/loki7l0).
14 |
15 | ## Usage
16 |
17 | The usage is pretty simple and straightforward. Simply call the following command from the project root:
18 |
19 | ``` .language-bash
20 | php artisan asgard:module:scaffold
21 | ```
22 |
23 | You will be asked the following questions:
24 |
25 |
26 | - What is the module name ?
27 |
28 | This is in the following format `vendor/name` all lowercase. *Do not use dashes in the module name*
29 | - Do you wish to use Doctrine or Eloquent ?
30 |
31 | This is to know what kind of Entities to generate.
32 |
33 | - Enter your desired entities
34 |
35 | You can enter as many as you like, when you're done leave empty and the next question will come up.
36 |
37 | - Enter you desired value objects
38 |
39 | Again, you can enter as many as you like, when you're done leave empty.
40 |
41 |
42 | When these questions are answered your module will be generated. You will still need to add the properties to the eloquent migration and/or to the entity (if using Doctrine).
43 |
44 | Before seeing the newly created module on the admin dashboard you will have to give you access to the new module. Go the the **User > Roles** view and edit the Admin role to give you permission to the new module.
45 |
--------------------------------------------------------------------------------
/v3/workshop-module/module-scaffold.md:
--------------------------------------------------------------------------------
1 | title: Create a module
2 | subtitle: Workshop Module
3 | -------
4 |
5 | - [Introduction](#introduction)
6 | - [Usage](#usage)
7 |
8 |
9 | ## Introduction
10 |
11 | The module scaffolder is a command line tool that will give you the ability to generate modules in a matter of seconds.
12 |
13 | To have a quick idea on what it does you can check out [this quickcast](http://quick.as/loki7l0).
14 |
15 | ## Usage
16 |
17 | The usage is pretty simple and straightforward. Simply call the following command from the project root:
18 |
19 | ``` .language-bash
20 | php artisan asgard:module:scaffold
21 | ```
22 |
23 | You will be asked the following questions:
24 |
25 |
26 | - What is the module name ?
27 |
28 | This is in the following format `vendor/name` all lowercase. *Do not use dashes in the module name*
29 | - Do you wish to use Doctrine or Eloquent ?
30 |
31 | This is to know what kind of Entities to generate.
32 |
33 | - Enter your desired entities
34 |
35 | You can enter as many as you like, when you're done leave empty and the next question will come up.
36 |
37 | - Enter you desired value objects
38 |
39 | Again, you can enter as many as you like, when you're done leave empty.
40 |
41 |
42 | When these questions are answered your module will be generated. You will still need to add the properties to the eloquent migration and/or to the entity (if using Doctrine).
43 |
44 | Before seeing the newly created module on the admin dashboard you will have to give you access to the new module. Go the the **User > Roles** view and edit the Admin role to give you permission to the new module.
45 |
--------------------------------------------------------------------------------
/v4/workshop-module/module-scaffold.md:
--------------------------------------------------------------------------------
1 | title: Create a module
2 | subtitle: Workshop Module
3 | -------
4 |
5 | - [Introduction](#introduction)
6 | - [Usage](#usage)
7 |
8 |
9 | ## Introduction
10 |
11 | The module scaffolder is a command line tool that will give you the ability to generate modules in a matter of seconds.
12 |
13 | To have a quick idea on what it does you can check out [this quickcast](http://quick.as/loki7l0).
14 |
15 | ## Usage
16 |
17 | The usage is pretty simple and straightforward. Simply call the following command from the project root:
18 |
19 | ``` .language-bash
20 | php artisan asgard:module:scaffold
21 | ```
22 |
23 | You will be asked the following questions:
24 |
25 |
26 | - What is the module name ?
27 |
28 | This is in the following format `vendor/name` all lowercase. *Do not use dashes in the module name*
29 | - Do you wish to use Doctrine or Eloquent ?
30 |
31 | This is to know what kind of Entities to generate.
32 |
33 | - Enter your desired entities
34 |
35 | You can enter as many as you like, when you're done leave empty and the next question will come up.
36 |
37 | - Enter you desired value objects
38 |
39 | Again, you can enter as many as you like, when you're done leave empty.
40 |
41 |
42 | When these questions are answered your module will be generated. You will still need to add the properties to the eloquent migration and/or to the entity (if using Doctrine).
43 |
44 | Before seeing the newly created module on the admin dashboard you will have to give you access to the new module. Go the the **User > Roles** view and edit the Admin role to give you permission to the new module.
45 |
--------------------------------------------------------------------------------
/v2/media-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: Media Module
3 | -------
4 |
5 | The following events are triggered in the Media Module:
6 |
7 | - [FileWasUploaded](#file-was-uploaded)
8 | - [FileWasLinked](#file-was-linked)
9 | - [FileWasUnlinked](#file-was-unlinked)
10 | - [FileWasCreated](#file-was-created)
11 | - [FileWasUpdated](#file-was-updated)
12 |
13 |
14 | ## FileWasUploaded
15 |
16 | Triggered when a file was uploaded. You have access to the complete [File entity](https://github.com/AsgardCms/Platform/blob/2.0/Modules/Media/Entities/File.php).
17 |
18 | ## FileWasLinked
19 |
20 | Triggered when a file was linked to an other entity. You have access to the complete [File entity](https://github.com/AsgardCms/Platform/blob/2.0/Modules/Media/Entities/File.php) as well as the linked entity.
21 |
22 | For instance if you link a cover image to your blog post, you'll have access to the file and to the post the file was linked too.
23 |
24 | ## FileWasUnlinked
25 |
26 |
27 | Triggered when a file was unlinked from an entity. You have access to the imageable relation.
28 |
29 | In this relation you have access to the `file_id`, the `type`, `type_id` and the `zone`.
30 |
31 | ## FileWasCreated
32 |
33 | Triggered when a file was created. This event has a public `$file` property.
34 |
35 | ## FileWasUpdated
36 |
37 | Triggered when a file was updated. This event has a public `$file` property.
38 |
--------------------------------------------------------------------------------
/v2/user-module/user-hooks.md:
--------------------------------------------------------------------------------
1 | title: User Hooks
2 | subtitle: User Module
3 | -------
4 |
5 | The user module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [UserIsCreating](#user-is-creating)
8 | - [UserIsUpdating](#user-is-updating)
9 | - [RoleIsCreating](#role-is-creating)
10 | - [RoleIsUpdating](#role-is-updating)
11 |
12 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
13 |
14 |
15 | ## UserIsCreating
16 |
17 |
18 | ## UserIsUpdating
19 |
20 | The `UserIsUpdating` has one more method:
21 |
22 | - `getUser()`: Will return the user being updated
23 |
24 |
25 | ### UserIsCreating Example
26 |
27 | To keep the example simple we're going to use an inline listener using a closure instead of a full class. Lets say you want to make sure the first and last names are using an upper case first letter, we could do this:
28 |
29 | ```.language-php
30 | Event::listen(UserIsCreating::class, function (UserIsCreating $event) {
31 | $attributes['first_name'] = ucfirst($event->getAttribute('first_name'));
32 | $attributes['last_name'] = ucfirst($event->getAttribute('last_name'));
33 | $event->setAttributes($attributes);
34 | });
35 | ```
36 |
37 | ## RoleIsCreating
38 |
39 | ## RoleIsUpdating
40 |
41 | The `RoleIsUpdating` has one more method:
42 |
43 | - `getRole()`: Will return the role being updated
44 |
--------------------------------------------------------------------------------
/v3/media-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: Media Module
3 | -------
4 |
5 | The following events are triggered in the Media Module:
6 |
7 | - [FileWasUploaded](#file-was-uploaded)
8 | - [FileWasLinked](#file-was-linked)
9 | - [FileWasUnlinked](#file-was-unlinked)
10 | - [FileWasCreated](#file-was-created)
11 | - [FileWasUpdated](#file-was-updated)
12 |
13 |
14 | ## FileWasUploaded
15 |
16 | Triggered when a file was uploaded. You have access to the complete [File entity](https://github.com/AsgardCms/Platform/blob/2.0/Modules/Media/Entities/File.php).
17 |
18 | ## FileWasLinked
19 |
20 | Triggered when a file was linked to an other entity. You have access to the complete [File entity](https://github.com/AsgardCms/Platform/blob/2.0/Modules/Media/Entities/File.php) as well as the linked entity.
21 |
22 | For instance if you link a cover image to your blog post, you'll have access to the file and to the post the file was linked too.
23 |
24 | ## FileWasUnlinked
25 |
26 |
27 | Triggered when a file was unlinked from an entity. You have access to the imageable relation.
28 |
29 | In this relation you have access to the `file_id`, the `type`, `type_id` and the `zone`.
30 |
31 | ## FileWasCreated
32 |
33 | Triggered when a file was created. This event has a public `$file` property.
34 |
35 | ## FileWasUpdated
36 |
37 | Triggered when a file was updated. This event has a public `$file` property.
38 |
--------------------------------------------------------------------------------
/v3/user-module/user-hooks.md:
--------------------------------------------------------------------------------
1 | title: User Hooks
2 | subtitle: User Module
3 | -------
4 |
5 | The user module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [UserIsCreating](#user-is-creating)
8 | - [UserIsUpdating](#user-is-updating)
9 | - [RoleIsCreating](#role-is-creating)
10 | - [RoleIsUpdating](#role-is-updating)
11 |
12 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
13 |
14 |
15 | ## UserIsCreating
16 |
17 |
18 | ## UserIsUpdating
19 |
20 | The `UserIsUpdating` has one more method:
21 |
22 | - `getUser()`: Will return the user being updated
23 |
24 |
25 | ### UserIsCreating Example
26 |
27 | To keep the example simple we're going to use an inline listener using a closure instead of a full class. Lets say you want to make sure the first and last names are using an upper case first letter, we could do this:
28 |
29 | ```.language-php
30 | Event::listen(UserIsCreating::class, function (UserIsCreating $event) {
31 | $attributes['first_name'] = ucfirst($event->getAttribute('first_name'));
32 | $attributes['last_name'] = ucfirst($event->getAttribute('last_name'));
33 | $event->setAttributes($attributes);
34 | });
35 | ```
36 |
37 | ## RoleIsCreating
38 |
39 | ## RoleIsUpdating
40 |
41 | The `RoleIsUpdating` has one more method:
42 |
43 | - `getRole()`: Will return the role being updated
44 |
--------------------------------------------------------------------------------
/v4/media-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: Media Module
3 | -------
4 |
5 | The following events are triggered in the Media Module:
6 |
7 | - [FileWasUploaded](#file-was-uploaded)
8 | - [FileWasLinked](#file-was-linked)
9 | - [FileWasUnlinked](#file-was-unlinked)
10 | - [FileWasCreated](#file-was-created)
11 | - [FileWasUpdated](#file-was-updated)
12 |
13 |
14 | ## FileWasUploaded
15 |
16 | Triggered when a file was uploaded. You have access to the complete [File entity](https://github.com/AsgardCms/Platform/blob/2.0/Modules/Media/Entities/File.php).
17 |
18 | ## FileWasLinked
19 |
20 | Triggered when a file was linked to an other entity. You have access to the complete [File entity](https://github.com/AsgardCms/Platform/blob/2.0/Modules/Media/Entities/File.php) as well as the linked entity.
21 |
22 | For instance if you link a cover image to your blog post, you'll have access to the file and to the post the file was linked too.
23 |
24 | ## FileWasUnlinked
25 |
26 |
27 | Triggered when a file was unlinked from an entity. You have access to the imageable relation.
28 |
29 | In this relation you have access to the `file_id`, the `type`, `type_id` and the `zone`.
30 |
31 | ## FileWasCreated
32 |
33 | Triggered when a file was created. This event has a public `$file` property.
34 |
35 | ## FileWasUpdated
36 |
37 | Triggered when a file was updated. This event has a public `$file` property.
38 |
--------------------------------------------------------------------------------
/v4/user-module/user-hooks.md:
--------------------------------------------------------------------------------
1 | title: User Hooks
2 | subtitle: User Module
3 | -------
4 |
5 | The user module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [UserIsCreating](#user-is-creating)
8 | - [UserIsUpdating](#user-is-updating)
9 | - [RoleIsCreating](#role-is-creating)
10 | - [RoleIsUpdating](#role-is-updating)
11 |
12 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
13 |
14 |
15 | ## UserIsCreating
16 |
17 |
18 | ## UserIsUpdating
19 |
20 | The `UserIsUpdating` has one more method:
21 |
22 | - `getUser()`: Will return the user being updated
23 |
24 |
25 | ### UserIsCreating Example
26 |
27 | To keep the example simple we're going to use an inline listener using a closure instead of a full class. Lets say you want to make sure the first and last names are using an upper case first letter, we could do this:
28 |
29 | ```.language-php
30 | Event::listen(UserIsCreating::class, function (UserIsCreating $event) {
31 | $attributes['first_name'] = ucfirst($event->getAttribute('first_name'));
32 | $attributes['last_name'] = ucfirst($event->getAttribute('last_name'));
33 | $event->setAttributes($attributes);
34 | });
35 | ```
36 |
37 | ## RoleIsCreating
38 |
39 | ## RoleIsUpdating
40 |
41 | The `RoleIsUpdating` has one more method:
42 |
43 | - `getRole()`: Will return the role being updated
44 |
--------------------------------------------------------------------------------
/v2/getting-started/used-technology.md:
--------------------------------------------------------------------------------
1 | title: Used technology
2 | subtitle: Getting Started
3 | -------
4 |
5 | - [Server requirements](#server-requirements)
6 | - [Used packages](#used-packages)
7 |
8 | ## Server requirements
9 |
10 | The server requirements are very similar to Laravel's server requirements:
11 |
12 | - PHP 5.6 or higher
13 | - PDO PHP Extension
14 | - cURL PHP Extension
15 | - OpenSSL PHP Extension
16 | - Mbstring PHP Extension
17 | - Tokenizer PHP Extension
18 | - GD PHP Library
19 | - MySql 5.5
20 |
21 |
22 | ## Used packages
23 |
24 | **AsgardCms** leverages the open source community by using the following packages. Please refer to their documentation for additional information on their usage in AsgardCMS.
25 |
26 | - [floatingpointsoftware/stylist](https://github.com/floatingpointsoftware/stylist)
27 | - [nwidart/laravel-modules](https://github.com/nWidart/laravel-modules)
28 | - [laravelcollective/html](https://github.com/laravelcollective/html)
29 | - [laracasts/presenter](https://github.com/laracasts/presenter)
30 | - [dimsav/laravel-translatable](https://github.com/dimsav/laravel-translatable)
31 | - [mcamara/laravel-localization](https://github.com/mcamara/laravel-localization)
32 | - [maatwebsite/laravel-sidebar](https://github.com/maatwebsite/laravel-sidebar)
33 | - [intervention/image](https://github.com/intervention/image)
34 | - [nwidart/laravel-menus](https://github.com/nwidart/laravel-menus)
35 | - [typicms/nestablecollection](https://github.com/typicms/nestablecollection)
36 | - [orchestra/testbench](https://github.com/orchestral/testbench)
37 | - [barryvdh/laravel-debugbar](https://github.com/barryvdh/laravel-debugbar)
38 |
39 |
40 | To every package developer on the above list, I'd like to say a big **thank you** for your much appreciated work.
--------------------------------------------------------------------------------
/v3/getting-started/used-technology.md:
--------------------------------------------------------------------------------
1 | title: Used technology
2 | subtitle: Getting Started
3 | -------
4 |
5 | - [Server requirements](#server-requirements)
6 | - [Used packages](#used-packages)
7 |
8 | ## Server requirements
9 |
10 | The server requirements are very similar to Laravel's server requirements:
11 |
12 | - PHP 5.6 or higher
13 | - PDO PHP Extension
14 | - cURL PHP Extension
15 | - OpenSSL PHP Extension
16 | - Mbstring PHP Extension
17 | - Tokenizer PHP Extension
18 | - GD PHP Library
19 | - MySql 5.5
20 |
21 |
22 | ## Used packages
23 |
24 | **AsgardCms** leverages the open source community by using the following packages. Please refer to their documentation for additional information on their usage in AsgardCMS.
25 |
26 | - [floatingpointsoftware/stylist](https://github.com/floatingpointsoftware/stylist)
27 | - [nwidart/laravel-modules](https://github.com/nWidart/laravel-modules)
28 | - [laravelcollective/html](https://github.com/laravelcollective/html)
29 | - [laracasts/presenter](https://github.com/laracasts/presenter)
30 | - [dimsav/laravel-translatable](https://github.com/dimsav/laravel-translatable)
31 | - [mcamara/laravel-localization](https://github.com/mcamara/laravel-localization)
32 | - [maatwebsite/laravel-sidebar](https://github.com/maatwebsite/laravel-sidebar)
33 | - [intervention/image](https://github.com/intervention/image)
34 | - [nwidart/laravel-menus](https://github.com/nwidart/laravel-menus)
35 | - [typicms/nestablecollection](https://github.com/typicms/nestablecollection)
36 | - [orchestra/testbench](https://github.com/orchestral/testbench)
37 | - [barryvdh/laravel-debugbar](https://github.com/barryvdh/laravel-debugbar)
38 |
39 |
40 | To every package developer on the above list, I'd like to say a big **thank you** for your much appreciated work.
--------------------------------------------------------------------------------
/v4/getting-started/used-technology.md:
--------------------------------------------------------------------------------
1 | title: Used technology
2 | subtitle: Getting Started
3 | -------
4 |
5 | - [Server requirements](#server-requirements)
6 | - [Used packages](#used-packages)
7 |
8 | ## Server requirements
9 |
10 | The server requirements are very similar to Laravel's server requirements:
11 |
12 | - PHP 5.6 or higher
13 | - PDO PHP Extension
14 | - cURL PHP Extension
15 | - OpenSSL PHP Extension
16 | - Mbstring PHP Extension
17 | - Tokenizer PHP Extension
18 | - GD PHP Library
19 | - MySql 5.5
20 |
21 |
22 | ## Used packages
23 |
24 | **AsgardCms** leverages the open source community by using the following packages. Please refer to their documentation for additional information on their usage in AsgardCMS.
25 |
26 | - [floatingpointsoftware/stylist](https://github.com/floatingpointsoftware/stylist)
27 | - [nwidart/laravel-modules](https://github.com/nWidart/laravel-modules)
28 | - [laravelcollective/html](https://github.com/laravelcollective/html)
29 | - [laracasts/presenter](https://github.com/laracasts/presenter)
30 | - [dimsav/laravel-translatable](https://github.com/dimsav/laravel-translatable)
31 | - [mcamara/laravel-localization](https://github.com/mcamara/laravel-localization)
32 | - [maatwebsite/laravel-sidebar](https://github.com/maatwebsite/laravel-sidebar)
33 | - [intervention/image](https://github.com/intervention/image)
34 | - [nwidart/laravel-menus](https://github.com/nwidart/laravel-menus)
35 | - [typicms/nestablecollection](https://github.com/typicms/nestablecollection)
36 | - [orchestra/testbench](https://github.com/orchestral/testbench)
37 | - [barryvdh/laravel-debugbar](https://github.com/barryvdh/laravel-debugbar)
38 |
39 |
40 | To every package developer on the above list, I'd like to say a big **thank you** for your much appreciated work.
--------------------------------------------------------------------------------
/v2/user-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: User Module
3 | -------
4 |
5 | The following events are triggered in the User Module:
6 |
7 | - [UserWasCreated](#user-was-created)
8 | - [UserWasUpdated](#user-was-updated)
9 | - [RoleWasCreated](#role-was-created)
10 | - [RoleWasUpdated](#role-was-updated)
11 | - [UserHasRegistered](#user-has-registered)
12 | - [UserHasBegunResetProcess](#user-has-begon-reset-process)
13 | - [UserHasActivatedAccount](#user-has-activated-account)
14 |
15 |
16 | ## UserWasCreated
17 |
18 | Triggered when a user was created. You have access to the complete User entity.
19 |
20 | ## UserWasUpdated
21 |
22 | Triggered when a user was updated. You have access to the complete User entity.
23 |
24 | ## RoleWasCreated
25 |
26 | Triggered when a role was created. You have access to the complete Role entity.
27 |
28 | ## RoleWasUpdated
29 |
30 | Triggered when a role was updated. You have access to the complete Role entity.
31 |
32 | ## UserHasRegistered
33 |
34 | Triggered when a user has registered. You have access to the complete User entity.
35 |
36 | ## UserHasBegunResetProcess
37 |
38 | Triggered when a user has begun the reset password process. You have access to the complete User entity and the reset code that was generated.
39 |
40 | ## UserHasActivatedAccount
41 |
42 | Triggered when a user has been activated. You have access to the complete User entity.
43 |
--------------------------------------------------------------------------------
/v3/user-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: User Module
3 | -------
4 |
5 | The following events are triggered in the User Module:
6 |
7 | - [UserWasCreated](#user-was-created)
8 | - [UserWasUpdated](#user-was-updated)
9 | - [RoleWasCreated](#role-was-created)
10 | - [RoleWasUpdated](#role-was-updated)
11 | - [UserHasRegistered](#user-has-registered)
12 | - [UserHasBegunResetProcess](#user-has-begon-reset-process)
13 | - [UserHasActivatedAccount](#user-has-activated-account)
14 |
15 |
16 | ## UserWasCreated
17 |
18 | Triggered when a user was created. You have access to the complete User entity.
19 |
20 | ## UserWasUpdated
21 |
22 | Triggered when a user was updated. You have access to the complete User entity.
23 |
24 | ## RoleWasCreated
25 |
26 | Triggered when a role was created. You have access to the complete Role entity.
27 |
28 | ## RoleWasUpdated
29 |
30 | Triggered when a role was updated. You have access to the complete Role entity.
31 |
32 | ## UserHasRegistered
33 |
34 | Triggered when a user has registered. You have access to the complete User entity.
35 |
36 | ## UserHasBegunResetProcess
37 |
38 | Triggered when a user has begun the reset password process. You have access to the complete User entity and the reset code that was generated.
39 |
40 | ## UserHasActivatedAccount
41 |
42 | Triggered when a user has been activated. You have access to the complete User entity.
43 |
--------------------------------------------------------------------------------
/v4/user-module/events.md:
--------------------------------------------------------------------------------
1 | title: Events
2 | subtitle: User Module
3 | -------
4 |
5 | The following events are triggered in the User Module:
6 |
7 | - [UserWasCreated](#user-was-created)
8 | - [UserWasUpdated](#user-was-updated)
9 | - [RoleWasCreated](#role-was-created)
10 | - [RoleWasUpdated](#role-was-updated)
11 | - [UserHasRegistered](#user-has-registered)
12 | - [UserHasBegunResetProcess](#user-has-begon-reset-process)
13 | - [UserHasActivatedAccount](#user-has-activated-account)
14 |
15 |
16 | ## UserWasCreated
17 |
18 | Triggered when a user was created. You have access to the complete User entity.
19 |
20 | ## UserWasUpdated
21 |
22 | Triggered when a user was updated. You have access to the complete User entity.
23 |
24 | ## RoleWasCreated
25 |
26 | Triggered when a role was created. You have access to the complete Role entity.
27 |
28 | ## RoleWasUpdated
29 |
30 | Triggered when a role was updated. You have access to the complete Role entity.
31 |
32 | ## UserHasRegistered
33 |
34 | Triggered when a user has registered. You have access to the complete User entity.
35 |
36 | ## UserHasBegunResetProcess
37 |
38 | Triggered when a user has begun the reset password process. You have access to the complete User entity and the reset code that was generated.
39 |
40 | ## UserHasActivatedAccount
41 |
42 | Triggered when a user has been activated. You have access to the complete User entity.
43 |
--------------------------------------------------------------------------------
/v2/media-module/configuration.md:
--------------------------------------------------------------------------------
1 | title: Configuration
2 | subtitle: Media Module
3 | -------
4 |
5 | - [Filesytem](#filesystem)
6 | - [Media assets path](#media-assets-path)
7 | - [Allowed types](#allowed-types)
8 | - [Max file size](#max-file-size)
9 | - [Max total size](#max-total-size)
10 |
11 | The **Media module** configuration file can be found at `config/asgard/media/config.php`.
12 |
13 | ## Filesystem
14 |
15 | Define the filesystem you would like to use to store the media. Currently only disk and s3 are supported.
16 |
17 | Feel free to an [UrlResolver](https://github.com/AsgardCms/Media/blob/master/UrlResolvers/BaseUrlResolver.php) for your desired filesystem as a pull request.
18 |
19 | ``` .language-php
20 | 'filesystem' => 'local',
21 | ```
22 |
23 | ## Media assets path
24 |
25 |
26 | This is the path where the media files will be uploaded.
27 |
28 | It defaults to `/assets/media/`.
29 |
30 | ``` .language-php
31 | 'files-path' => '/assets/media/',
32 | ```
33 |
34 | ## Allowed types
35 |
36 | Specify all the allowed file extensions a user can upload on the server.
37 |
38 | It defaults to `.jpg,.png`.
39 |
40 | ``` .language-php
41 | 'allowed-types' => '.jpg,.png',
42 | ```
43 |
44 | ## Max file size
45 |
46 | Determine the max file size upload rate, defined in **mb**.
47 |
48 | It defaults to **5mb**.
49 |
50 | ``` .language-php
51 | 'max-file-size' => '5',
52 | ```
53 |
54 | ## Max total size
55 |
56 | Determine the max total media folder size, expressed in bytes.
57 |
58 | It defaults to **1000000000 bytes** (1gb).
59 |
60 | ``` .language-php
61 | 'max-total-size' => 1000000000,
62 | ```
63 |
--------------------------------------------------------------------------------
/v3/media-module/configuration.md:
--------------------------------------------------------------------------------
1 | title: Configuration
2 | subtitle: Media Module
3 | -------
4 |
5 | - [Filesytem](#filesystem)
6 | - [Media assets path](#media-assets-path)
7 | - [Allowed types](#allowed-types)
8 | - [Max file size](#max-file-size)
9 | - [Max total size](#max-total-size)
10 |
11 | The **Media module** configuration file can be found at `config/asgard/media/config.php`.
12 |
13 | ## Filesystem
14 |
15 | Define the filesystem you would like to use to store the media. Currently only disk and s3 are supported.
16 |
17 | Feel free to an [UrlResolver](https://github.com/AsgardCms/Media/blob/master/UrlResolvers/BaseUrlResolver.php) for your desired filesystem as a pull request.
18 |
19 | ``` .language-php
20 | 'filesystem' => 'local',
21 | ```
22 |
23 | ## Media assets path
24 |
25 |
26 | This is the path where the media files will be uploaded.
27 |
28 | It defaults to `/assets/media/`.
29 |
30 | ``` .language-php
31 | 'files-path' => '/assets/media/',
32 | ```
33 |
34 | ## Allowed types
35 |
36 | Specify all the allowed file extensions a user can upload on the server.
37 |
38 | It defaults to `.jpg,.png`.
39 |
40 | ``` .language-php
41 | 'allowed-types' => '.jpg,.png',
42 | ```
43 |
44 | ## Max file size
45 |
46 | Determine the max file size upload rate, defined in **mb**.
47 |
48 | It defaults to **5mb**.
49 |
50 | ``` .language-php
51 | 'max-file-size' => '5',
52 | ```
53 |
54 | ## Max total size
55 |
56 | Determine the max total media folder size, expressed in bytes.
57 |
58 | It defaults to **1000000000 bytes** (1gb).
59 |
60 | ``` .language-php
61 | 'max-total-size' => 1000000000,
62 | ```
63 |
--------------------------------------------------------------------------------
/v4/media-module/configuration.md:
--------------------------------------------------------------------------------
1 | title: Configuration
2 | subtitle: Media Module
3 | -------
4 |
5 | - [Filesytem](#filesystem)
6 | - [Media assets path](#media-assets-path)
7 | - [Allowed types](#allowed-types)
8 | - [Max file size](#max-file-size)
9 | - [Max total size](#max-total-size)
10 |
11 | The **Media module** configuration file can be found at `config/asgard/media/config.php`.
12 |
13 | ## Filesystem
14 |
15 | Define the filesystem you would like to use to store the media. Currently only disk and s3 are supported.
16 |
17 | Feel free to an [UrlResolver](https://github.com/AsgardCms/Media/blob/master/UrlResolvers/BaseUrlResolver.php) for your desired filesystem as a pull request.
18 |
19 | ``` .language-php
20 | 'filesystem' => 'local',
21 | ```
22 |
23 | ## Media assets path
24 |
25 |
26 | This is the path where the media files will be uploaded.
27 |
28 | It defaults to `/assets/media/`.
29 |
30 | ``` .language-php
31 | 'files-path' => '/assets/media/',
32 | ```
33 |
34 | ## Allowed types
35 |
36 | Specify all the allowed file extensions a user can upload on the server.
37 |
38 | It defaults to `.jpg,.png`.
39 |
40 | ``` .language-php
41 | 'allowed-types' => '.jpg,.png',
42 | ```
43 |
44 | ## Max file size
45 |
46 | Determine the max file size upload rate, defined in **mb**.
47 |
48 | It defaults to **5mb**.
49 |
50 | ``` .language-php
51 | 'max-file-size' => '5',
52 | ```
53 |
54 | ## Max total size
55 |
56 | Determine the max total media folder size, expressed in bytes.
57 |
58 | It defaults to **1000000000 bytes** (1gb).
59 |
60 | ``` .language-php
61 | 'max-total-size' => 1000000000,
62 | ```
63 |
--------------------------------------------------------------------------------
/v1/media-module/configuration.md:
--------------------------------------------------------------------------------
1 | title: Configuration
2 | subtitle: Media Module
3 | -------
4 |
5 | - [Filesytem](#filesystem)
6 | - [Media assets path](#media-assets-path)
7 | - [Allowed types](#allowed-types)
8 | - [Max file size](#max-file-size)
9 | - [Max total size](#max-total-size)
10 |
11 | The **Media module** configuration file can be found at `config/asgard.media.config.php`.
12 |
13 | ## Filesystem
14 |
15 | Define the filesystem you would like to use to store the media. Currently only disk and s3 are supported.
16 |
17 | Feel free to an [UrlResolver](https://github.com/AsgardCms/Media/blob/master/UrlResolvers/BaseUrlResolver.php) for your desired filesystem as a pull request.
18 |
19 | ``` .language-php
20 | 'filesystem' => 'local',
21 | ```
22 |
23 | ## Media assets path
24 |
25 |
26 | This is the path where the media files will be uploaded.
27 |
28 | It defaults to `/assets/media/`.
29 |
30 | ``` .language-php
31 | 'files-path' => '/assets/media/',
32 | ```
33 |
34 | ## Allowed types
35 |
36 | Specify all the allowed file extensions a user can upload on the server.
37 |
38 | It defaults to `.jpg,.png`.
39 |
40 | ``` .language-php
41 | 'allowed-types' => '.jpg,.png',
42 | ```
43 |
44 | ## Max file size
45 |
46 | Determine the max file size upload rate, defined in **mb**.
47 |
48 | It defaults to **5mb**.
49 |
50 | ``` .language-php
51 | 'max-file-size' => '5',
52 | ```
53 |
54 | ## Max total size
55 |
56 | Determine the max total media folder size, expressed in bytes.
57 |
58 | It defaults to **1000000000 bytes** (1gb).
59 |
60 | ``` .language-php
61 | 'max-total-size' => 1000000000,
62 | ```
63 |
--------------------------------------------------------------------------------
/v2/user-module/users.md:
--------------------------------------------------------------------------------
1 | title: Users
2 | subtitle: User Module
3 | -------
4 |
5 | - [Getting logged in User](#getting-logged-in-user)
6 | - [Getting logged in User in views](#getting-logged-in-user-in-views)
7 |
8 | ## Getting logged in User
9 |
10 | To get the currently logged in user you can inject the [Authentication interface](https://github.com/AsgardCms/Core/blob/master/Contracts/Authentication.php) in your controller, or a view composer and using the following:
11 |
12 | ``` .language-php
13 | $user = $this->auth->check();
14 | ```
15 |
16 | If `$user` is false, means the current user isn't logged in. Otherwise you'll get the currently logged in user.
17 |
18 | Check the method signature:
19 |
20 | ``` .language-php
21 | /**
22 | * Check if the user is logged in, if so return the current user
23 | * @return bool|object
24 | */
25 | public function check();
26 | ```
27 |
28 |
29 | ## Getting logged in User in views
30 |
31 | ### Recommended: View Composer
32 |
33 | The recommended way of attaching the `$currentUser` variable to your desired views is by binding the `CurrentUserViewComposer` to your view(s).
34 |
35 | Let's say you want the current user on the `layouts.demo` view, you can add the following code to your module's service provider:
36 |
37 | ``` .language-php
38 | view()->composer('layouts.demo', \Modules\Core\Composers\CurrentUserViewComposer::class);
39 | ```
40 |
41 | ### Class inheritence
42 |
43 | Start by making your public controllers extend the following class:
44 |
45 | ``` .language-php
46 | Modules\Core\Http\Controllers\BasePublicController
47 | ```
48 |
49 | Now, in any public view, you have access to a `$currentUser` variable that corresponds to the currently authenticated user. `$currentUser` will evaluate to false if none logged in.
50 |
--------------------------------------------------------------------------------
/v3/user-module/users.md:
--------------------------------------------------------------------------------
1 | title: Users
2 | subtitle: User Module
3 | -------
4 |
5 | - [Getting logged in User](#getting-logged-in-user)
6 | - [Getting logged in User in views](#getting-logged-in-user-in-views)
7 |
8 | ## Getting logged in User
9 |
10 | To get the currently logged in user you can inject the [Authentication interface](https://github.com/AsgardCms/Core/blob/master/Contracts/Authentication.php) in your controller, or a view composer and using the following:
11 |
12 | ``` .language-php
13 | $user = $this->auth->check();
14 | ```
15 |
16 | If `$user` is false, means the current user isn't logged in. Otherwise you'll get the currently logged in user.
17 |
18 | Check the method signature:
19 |
20 | ``` .language-php
21 | /**
22 | * Check if the user is logged in, if so return the current user
23 | * @return bool|object
24 | */
25 | public function check();
26 | ```
27 |
28 |
29 | ## Getting logged in User in views
30 |
31 | ### Recommended: View Composer
32 |
33 | The recommended way of attaching the `$currentUser` variable to your desired views is by binding the `CurrentUserViewComposer` to your view(s).
34 |
35 | Let's say you want the current user on the `layouts.demo` view, you can add the following code to your module's service provider:
36 |
37 | ``` .language-php
38 | view()->composer('layouts.demo', \Modules\Core\Composers\CurrentUserViewComposer::class);
39 | ```
40 |
41 | ### Class inheritence
42 |
43 | Start by making your public controllers extend the following class:
44 |
45 | ``` .language-php
46 | Modules\Core\Http\Controllers\BasePublicController
47 | ```
48 |
49 | Now, in any public view, you have access to a `$currentUser` variable that corresponds to the currently authenticated user. `$currentUser` will evaluate to false if none logged in.
50 |
--------------------------------------------------------------------------------
/v4/user-module/users.md:
--------------------------------------------------------------------------------
1 | title: Users
2 | subtitle: User Module
3 | -------
4 |
5 | - [Getting logged in User](#getting-logged-in-user)
6 | - [Getting logged in User in views](#getting-logged-in-user-in-views)
7 |
8 | ## Getting logged in User
9 |
10 | To get the currently logged in user you can inject the [Authentication interface](https://github.com/AsgardCms/Core/blob/master/Contracts/Authentication.php) in your controller, or a view composer and using the following:
11 |
12 | ``` .language-php
13 | $user = $this->auth->check();
14 | ```
15 |
16 | If `$user` is false, means the current user isn't logged in. Otherwise you'll get the currently logged in user.
17 |
18 | Check the method signature:
19 |
20 | ``` .language-php
21 | /**
22 | * Check if the user is logged in, if so return the current user
23 | * @return bool|object
24 | */
25 | public function check();
26 | ```
27 |
28 |
29 | ## Getting logged in User in views
30 |
31 | ### Recommended: View Composer
32 |
33 | The recommended way of attaching the `$currentUser` variable to your desired views is by binding the `CurrentUserViewComposer` to your view(s).
34 |
35 | Let's say you want the current user on the `layouts.demo` view, you can add the following code to your module's service provider:
36 |
37 | ``` .language-php
38 | view()->composer('layouts.demo', \Modules\Core\Composers\CurrentUserViewComposer::class);
39 | ```
40 |
41 | ### Class inheritence
42 |
43 | Start by making your public controllers extend the following class:
44 |
45 | ``` .language-php
46 | Modules\Core\Http\Controllers\BasePublicController
47 | ```
48 |
49 | Now, in any public view, you have access to a `$currentUser` variable that corresponds to the currently authenticated user. `$currentUser` will evaluate to false if none logged in.
50 |
--------------------------------------------------------------------------------
/v1/user-module/users.md:
--------------------------------------------------------------------------------
1 | title: Users
2 | subtitle: User Module
3 | -------
4 |
5 | - [Getting logged in User](#getting-logged-in-user)
6 | - [Getting logged in User in views](#getting-logged-in-user-in-views)
7 |
8 | ## Getting logged in User
9 |
10 | To get the currently logged in user you can inject the [Authentication interface](https://github.com/AsgardCms/Core/blob/master/Contracts/Authentication.php) in your controller, or a view composer and using the following:
11 |
12 | ``` .language-php
13 | $user = $this->auth->check();
14 | ```
15 |
16 | If `$user` is false, means the current user isn't logged in. Otherwise you'll get the currently logged in user.
17 |
18 | Check the method signature:
19 |
20 | ``` .language-php
21 | /**
22 | * Check if the user is logged in, if so return the current user
23 | * @return bool|object
24 | */
25 | public function check();
26 | ```
27 |
28 |
29 | ## Getting logged in User in views
30 |
31 | ### Recommended: View Composer
32 |
33 | The recommended way of attaching the `$currentUser` variable to your desired views is by binding the `CurrentUserViewComposer` to your view(s).
34 |
35 | Let's say you want the current user on the `layouts.demo` view, you can add the following code to your module's service provider:
36 |
37 | ``` .language-php
38 | view()->composer('layouts.demo', \Modules\Core\Composers\CurrentUserViewComposer::class);
39 | ```
40 |
41 | ### Class inheritence
42 |
43 | Start by making your public controllers extend the following class:
44 |
45 | ``` .language-php
46 | Modules\Core\Http\Controllers\BasePublicController
47 | ```
48 |
49 | Now, in any public view, you have access to a `$currentUser` variable that corresponds to the currently authenticated user. `$currentUser` will evaluate to false if none logged in.
50 |
--------------------------------------------------------------------------------
/v1/getting-started/used-technology.md:
--------------------------------------------------------------------------------
1 | title: Used technology
2 | subtitle: Getting Started
3 | -------
4 |
5 | - [Server requirements](#server-requirements)
6 | - [Used packages](#used-packages)
7 |
8 | ### Server requirements
9 |
10 | The server requirements are very similar to Laravel's server requirements:
11 |
12 | - PHP 5.5.9 or higher
13 | - PDO PHP Extension
14 | - cURL PHP Extension
15 | - OpenSSL PHP Extension
16 | - Mbstring PHP Extension
17 | - Tokenizer PHP Extension
18 | - GD PHP Library
19 | - MySql 5.5
20 |
21 |
22 | ### Used packages
23 |
24 | **AsgardCms** leverages the open source community by using the following packages. Please refer to their documentation for additional information on their usage in AsgardCms.
25 |
26 | - [floatingpointsoftware/stylist](https://github.com/floatingpointsoftware/stylist)
27 | - [pingpong-labs/modules](https://github.com/pingpong-labs/modules)
28 | - [laravelcollective/html](https://github.com/laravelcollective/html)
29 | - [laracasts/flash](https://github.com/laracasts/flash)
30 | - [laracasts/presenter](https://github.com/laracasts/presenter)
31 | - [dimsav/laravel-translatable](https://github.com/dimsav/laravel-translatable)
32 | - [mcamara/laravel-localization](https://github.com/mcamara/laravel-localization)
33 | - [maatwebsite/laravel-sidebar](https://github.com/maatwebsite/laravel-sidebar)
34 | - [intervention/image](https://github.com/intervention/image)
35 | - [pingpong-labs/menus](https://github.com/pingpong-labs/menus)
36 | - [typicms/nestablecollection](https://github.com/typicms/nestablecollection)
37 | - [orchestra/testbench](https://github.com/orchestral/testbench)
38 | - [barryvdh/laravel-debugbar](https://github.com/barryvdh/laravel-debugbar)
39 |
40 |
41 | To every package developer on the above list, I'd like to say a big **thank you** for your much appreciated work.
--------------------------------------------------------------------------------
/v2/workshop-module/generate-entity-files.md:
--------------------------------------------------------------------------------
1 | title: Generate entity files
2 | subtitle: Workshop Module
3 | -------
4 |
5 | - [Introduction](#introduction)
6 | - [Usage](#usage)
7 |
8 |
9 | ## Introduction
10 |
11 |
12 | When scaffolding a module it will ask which entities you would like to have generated. This is useful however it can happen that you didn't think of one during the scaffolding.
13 |
14 | One option would be to create all necessary files manually, or using the following command have them all generated for you.
15 |
16 | ## Usage
17 |
18 | Using the following artisan command will generate all files and classes for entered entity.
19 |
20 | ``` .language-bash
21 | php artisan asgard:entity:scaffold
22 | ```
23 |
24 | First argument is the entity you'd like to add, and second the module to which it needs to be added.
25 |
26 | If you want to add a `Category` entity to the `Recipe` module this would be your command:
27 |
28 | ``` .language-bash
29 | php artisan asgard:entity:scaffold Category Recipe
30 | ```
31 |
32 | This will generate all following files :
33 |
34 | - The `Category` and `CategoryTranslation` entities,
35 | - The migration files for both entities,
36 | - Admin controller class,
37 | - Admin routes,
38 | - Permissions,
39 | - Repository (interface + eloquent implementation + cache decorator + binding in service provider),
40 | - Views,
41 | - Language file,
42 | - Adding link to `Sidebar` class.
43 |
44 | ### Requirements
45 |
46 | For AsgardCMS to know where to append certain data, it needs to have the original comments in the files generated by the module scaffold.
47 |
48 | - `// add bindings` in the module service provider,
49 | - `// append` in the `adminRoutes.php` file,
50 | - `// append` in the `permissions.php` config file,
51 | - `// append` in the `Sidebar` class.
52 |
53 | Omitting those comments will simply mean those parts won't be generated.
54 |
--------------------------------------------------------------------------------
/v3/workshop-module/generate-entity-files.md:
--------------------------------------------------------------------------------
1 | title: Generate entity files
2 | subtitle: Workshop Module
3 | -------
4 |
5 | - [Introduction](#introduction)
6 | - [Usage](#usage)
7 |
8 |
9 | ## Introduction
10 |
11 |
12 | When scaffolding a module it will ask which entities you would like to have generated. This is useful however it can happen that you didn't think of one during the scaffolding.
13 |
14 | One option would be to create all necessary files manually, or using the following command have them all generated for you.
15 |
16 | ## Usage
17 |
18 | Using the following artisan command will generate all files and classes for entered entity.
19 |
20 | ``` .language-bash
21 | php artisan asgard:entity:scaffold
22 | ```
23 |
24 | First argument is the entity you'd like to add, and second the module to which it needs to be added.
25 |
26 | If you want to add a `Category` entity to the `Recipe` module this would be your command:
27 |
28 | ``` .language-bash
29 | php artisan asgard:entity:scaffold Category Recipe
30 | ```
31 |
32 | This will generate all following files :
33 |
34 | - The `Category` and `CategoryTranslation` entities,
35 | - The migration files for both entities,
36 | - Admin controller class,
37 | - Admin routes,
38 | - Permissions,
39 | - Repository (interface + eloquent implementation + cache decorator + binding in service provider),
40 | - Views,
41 | - Language file,
42 | - Adding link to `Sidebar` class.
43 |
44 | ### Requirements
45 |
46 | For AsgardCMS to know where to append certain data, it needs to have the original comments in the files generated by the module scaffold.
47 |
48 | - `// add bindings` in the module service provider,
49 | - `// append` in the `adminRoutes.php` file,
50 | - `// append` in the `permissions.php` config file,
51 | - `// append` in the `Sidebar` class.
52 |
53 | Omitting those comments will simply mean those parts won't be generated.
54 |
--------------------------------------------------------------------------------
/v4/workshop-module/generate-entity-files.md:
--------------------------------------------------------------------------------
1 | title: Generate entity files
2 | subtitle: Workshop Module
3 | -------
4 |
5 | - [Introduction](#introduction)
6 | - [Usage](#usage)
7 |
8 |
9 | ## Introduction
10 |
11 |
12 | When scaffolding a module it will ask which entities you would like to have generated. This is useful however it can happen that you didn't think of one during the scaffolding.
13 |
14 | One option would be to create all necessary files manually, or using the following command have them all generated for you.
15 |
16 | ## Usage
17 |
18 | Using the following artisan command will generate all files and classes for entered entity.
19 |
20 | ``` .language-bash
21 | php artisan asgard:entity:scaffold
22 | ```
23 |
24 | First argument is the entity you'd like to add, and second the module to which it needs to be added.
25 |
26 | If you want to add a `Category` entity to the `Recipe` module this would be your command:
27 |
28 | ``` .language-bash
29 | php artisan asgard:entity:scaffold Category Recipe
30 | ```
31 |
32 | This will generate all following files :
33 |
34 | - The `Category` and `CategoryTranslation` entities,
35 | - The migration files for both entities,
36 | - Admin controller class,
37 | - Admin routes,
38 | - Permissions,
39 | - Repository (interface + eloquent implementation + cache decorator + binding in service provider),
40 | - Views,
41 | - Language file,
42 | - Adding link to `Sidebar` class.
43 |
44 | ### Requirements
45 |
46 | For AsgardCMS to know where to append certain data, it needs to have the original comments in the files generated by the module scaffold.
47 |
48 | - `// add bindings` in the module service provider,
49 | - `// append` in the `adminRoutes.php` file,
50 | - `// append` in the `permissions.php` config file,
51 | - `// append` in the `Sidebar` class.
52 |
53 | Omitting those comments will simply mean those parts won't be generated.
54 |
--------------------------------------------------------------------------------
/v2/tag-module/convenience-methods.md:
--------------------------------------------------------------------------------
1 | title: Convenience methods
2 | subtitle: Tag Module
3 | -------
4 |
5 | - [Scope: `withTag()`](#scope-with-tag)
6 | - [Scope: `whereTag()`](#scope-where-tag)
7 | - [Get all tags for an entity: `allTags()`](#all-tags-for-entity)
8 | - [Delete tags for an entity](#delete-tags-for-entity)
9 |
10 |
11 | ## Scope: `withTag()`
12 |
13 | Get all the entities with one of the given tag(s). Optionally specify the column on which to perform the search operation, defaults to the `slug` column.
14 |
15 | Example in your repository :
16 |
17 | ``` .language-php
18 | // Get all files with either of the 2 tags
19 | $files = $this->file->withTag(['your-first-tag', 'some-other-tag'])->get();
20 | ```
21 |
22 |
23 | ## Scope: `whereTag()`
24 |
25 |
26 | Get all the entities with the given tag(s). Optionally specify the column on which to perform the search operation, defaults to `slug` column.
27 |
28 | Example in your repository :
29 |
30 | ``` .language-php
31 | // Get all files with all given tags
32 | $files = $this->file->whereTag(['your-first-tag', 'some-other-tag'])->get();
33 |
34 | // Get all files with the given tag
35 | $files = $this->file->whereTag('your-first-tag')->get();
36 | ```
37 |
38 |
39 |
40 | ## Get all tags for an entity: `allTags()`
41 |
42 |
43 | You can fetch all the tags for an entity by using the `allTags()` method.
44 |
45 | ``` .language-php
46 | $tags = $file->allTags();
47 | ```
48 |
49 |
50 | ## Delete tags for an entity: `untag()`
51 |
52 | To remove all tags from your entity call the `untag()` method on it.
53 |
54 | ``` .language-php
55 | $file->untag();
56 | ```
57 |
58 | You can also pass in an array of tags (`Tag` entity) to remove specific tags. You shouldn't have to call this yourself.
59 |
60 |
61 |
--------------------------------------------------------------------------------
/v3/tag-module/convenience-methods.md:
--------------------------------------------------------------------------------
1 | title: Convenience methods
2 | subtitle: Tag Module
3 | -------
4 |
5 | - [Scope: `withTag()`](#scope-with-tag)
6 | - [Scope: `whereTag()`](#scope-where-tag)
7 | - [Get all tags for an entity: `allTags()`](#all-tags-for-entity)
8 | - [Delete tags for an entity](#delete-tags-for-entity)
9 |
10 |
11 | ## Scope: `withTag()`
12 |
13 | Get all the entities with one of the given tag(s). Optionally specify the column on which to perform the search operation, defaults to the `slug` column.
14 |
15 | Example in your repository :
16 |
17 | ``` .language-php
18 | // Get all files with either of the 2 tags
19 | $files = $this->file->withTag(['your-first-tag', 'some-other-tag'])->get();
20 | ```
21 |
22 |
23 | ## Scope: `whereTag()`
24 |
25 |
26 | Get all the entities with the given tag(s). Optionally specify the column on which to perform the search operation, defaults to `slug` column.
27 |
28 | Example in your repository :
29 |
30 | ``` .language-php
31 | // Get all files with all given tags
32 | $files = $this->file->whereTag(['your-first-tag', 'some-other-tag'])->get();
33 |
34 | // Get all files with the given tag
35 | $files = $this->file->whereTag('your-first-tag')->get();
36 | ```
37 |
38 |
39 |
40 | ## Get all tags for an entity: `allTags()`
41 |
42 |
43 | You can fetch all the tags for an entity by using the `allTags()` method.
44 |
45 | ``` .language-php
46 | $tags = $file->allTags();
47 | ```
48 |
49 |
50 | ## Delete tags for an entity: `untag()`
51 |
52 | To remove all tags from your entity call the `untag()` method on it.
53 |
54 | ``` .language-php
55 | $file->untag();
56 | ```
57 |
58 | You can also pass in an array of tags (`Tag` entity) to remove specific tags. You shouldn't have to call this yourself.
59 |
60 |
61 |
--------------------------------------------------------------------------------
/v4/tag-module/convenience-methods.md:
--------------------------------------------------------------------------------
1 | title: Convenience methods
2 | subtitle: Tag Module
3 | -------
4 |
5 | - [Scope: `withTag()`](#scope-with-tag)
6 | - [Scope: `whereTag()`](#scope-where-tag)
7 | - [Get all tags for an entity: `allTags()`](#all-tags-for-entity)
8 | - [Delete tags for an entity](#delete-tags-for-entity)
9 |
10 |
11 | ## Scope: `withTag()`
12 |
13 | Get all the entities with one of the given tag(s). Optionally specify the column on which to perform the search operation, defaults to the `slug` column.
14 |
15 | Example in your repository :
16 |
17 | ``` .language-php
18 | // Get all files with either of the 2 tags
19 | $files = $this->file->withTag(['your-first-tag', 'some-other-tag'])->get();
20 | ```
21 |
22 |
23 | ## Scope: `whereTag()`
24 |
25 |
26 | Get all the entities with the given tag(s). Optionally specify the column on which to perform the search operation, defaults to `slug` column.
27 |
28 | Example in your repository :
29 |
30 | ``` .language-php
31 | // Get all files with all given tags
32 | $files = $this->file->whereTag(['your-first-tag', 'some-other-tag'])->get();
33 |
34 | // Get all files with the given tag
35 | $files = $this->file->whereTag('your-first-tag')->get();
36 | ```
37 |
38 |
39 |
40 | ## Get all tags for an entity: `allTags()`
41 |
42 |
43 | You can fetch all the tags for an entity by using the `allTags()` method.
44 |
45 | ``` .language-php
46 | $tags = $file->allTags();
47 | ```
48 |
49 |
50 | ## Delete tags for an entity: `untag()`
51 |
52 | To remove all tags from your entity call the `untag()` method on it.
53 |
54 | ``` .language-php
55 | $file->untag();
56 | ```
57 |
58 | You can also pass in an array of tags (`Tag` entity) to remove specific tags. You shouldn't have to call this yourself.
59 |
60 |
61 |
--------------------------------------------------------------------------------
/v2/page-module/custom-fields.md:
--------------------------------------------------------------------------------
1 | title: Custom Fields
2 | subtitle: Page Module
3 | -------
4 |
5 | - [Configuration](#configuration)
6 | - [Hooking in events](#events)
7 | - [Usage](#usage)
8 |
9 | It is often required to add more fields to a page than the default provided ones. For this reason you can add any type of custom field to the Page Module.
10 |
11 | For an in-depth overview you can watch the following video on [adding custom fields to the page module](https://www.youtube.com/watch?v=HpzYIWOdzv8).
12 |
13 |
14 | ## Configuration
15 |
16 |
17 | ### Defining the fields
18 |
19 | In the Page module config file located at `Config/asgard.page.config.php` you'll see the following configuration options:
20 |
21 | ``` .language-php
22 | 'partials' => [
23 | 'translatable' => [
24 | 'create' => [],
25 | 'edit' => [],
26 | ],
27 | 'normal' => [
28 | 'create' => [],
29 | 'edit' => [],
30 | ],
31 | ],
32 | ```
33 |
34 | In these arrays you can give on array of fields for translatable fields (create & edit) and non translatable fields (create & edit). Those will be shown on the page create and edit views.
35 |
36 |
37 | ### Defining the relation
38 |
39 | In that same config file you'll also see a `relations` key, just as with the User module, you can add dynamic relations with the Page entity. This will mostly be with your custom module that will have the entity with the additional data to be stored
40 |
41 | ## Events
42 |
43 | The way to 'intercept' the posted data, is by hooking into the `PageWasCreated` and `PageWasUpdated` events. These events both have the `pageId` (int) and `data` (array). The `data` contains the **posted data**.
44 |
45 |
46 | ## Usage
47 |
48 | With the configuration setup, and your event handlers in place, you'll have the custom data stored in database. To display the data you can simply call the relation you setup in the configuration as a *method*.
49 |
50 | ``` .language-php
51 | $page->yourRelation()->custom_field
52 | ```
53 |
--------------------------------------------------------------------------------
/v2/upgrade-guides/platform.md:
--------------------------------------------------------------------------------
1 | title: Upgrade Guide
2 | subtitle: Platform
3 | -------
4 |
5 | - [From v2.4.0 to v2.5.0](#upgrade-2.5.0)
6 | - [From v2.3.0 to v2.4.0](#upgrade-2.4.0)
7 | - [From v1 to v2](#upgrade-2.0)
8 | - [From 1.12.0 to 1.13.0](#upgrade-1.13.0)
9 |
10 |
11 | ## From v2.4.0 to **v2.5.0**
12 |
13 | **New cache driver**
14 |
15 | A new cache driver was added specifically for translations. [You can view this configuration here](https://github.com/AsgardCms/Platform/blob/2.0/config/cache.php#L74-L77). You can also set the environment variable `TRANSLATIONS_CACHE_DRIVER` in your `.env` file to use redis for example or any other driver.
16 |
17 |
18 | ## From v2.3.0 to **v2.4.0**
19 |
20 | **Local Filesystem**
21 |
22 | The local filesystem drivers was updated to match laravel. [You will need to apply those changes.](https://github.com/AsgardCms/Platform/blob/2.0/config/filesystems.php#L59-L60)
23 |
24 | ## From v1 to **v2**
25 |
26 | **Upgrade to laravel 5.2**
27 |
28 | Follow the [Laravel upgrade guide](https://laravel.com/docs/5.2/upgrade#upgrade-5.2.0) to upgrade your application and modules.
29 |
30 | **Re-publish configuration files**
31 |
32 | Configuration files across modules has been changed, mostly the `permissions.php` files.
33 |
34 | Using the following command you will be able to publish a module config files.
35 |
36 | ``` .language-bash
37 | php artisan module:publish-config --force
38 | ```
39 |
40 | If you edited the module configurations, you will need to manually copy over the new files, depending on what you changed, you can also publish each module individually.
41 |
42 |
43 |
44 | ## From 1.12.0 to **1.13.0**
45 |
46 | **New Job class**
47 |
48 | The laravel abstract `Job` class has been added in `app/Jobs/Job.php`. Add the `Job` class ([view class](https://github.com/AsgardCms/Platform/blob/master/app/Jobs/Job.php)) to your project in that same location (`app/Jobs/Job.php`).
49 |
--------------------------------------------------------------------------------
/v3/page-module/custom-fields.md:
--------------------------------------------------------------------------------
1 | title: Custom Fields
2 | subtitle: Page Module
3 | -------
4 |
5 | - [Configuration](#configuration)
6 | - [Hooking in events](#events)
7 | - [Usage](#usage)
8 |
9 | It is often required to add more fields to a page than the default provided ones. For this reason you can add any type of custom field to the Page Module.
10 |
11 | For an in-depth overview you can watch the following video on [adding custom fields to the page module](https://www.youtube.com/watch?v=HpzYIWOdzv8).
12 |
13 |
14 | ## Configuration
15 |
16 |
17 | ### Defining the fields
18 |
19 | In the Page module config file located at `Config/asgard.page.config.php` you'll see the following configuration options:
20 |
21 | ``` .language-php
22 | 'partials' => [
23 | 'translatable' => [
24 | 'create' => [],
25 | 'edit' => [],
26 | ],
27 | 'normal' => [
28 | 'create' => [],
29 | 'edit' => [],
30 | ],
31 | ],
32 | ```
33 |
34 | In these arrays you can give on array of fields for translatable fields (create & edit) and non translatable fields (create & edit). Those will be shown on the page create and edit views.
35 |
36 |
37 | ### Defining the relation
38 |
39 | In that same config file you'll also see a `relations` key, just as with the User module, you can add dynamic relations with the Page entity. This will mostly be with your custom module that will have the entity with the additional data to be stored
40 |
41 | ## Events
42 |
43 | The way to 'intercept' the posted data, is by hooking into the `PageWasCreated` and `PageWasUpdated` events. These events both have the `pageId` (int) and `data` (array). The `data` contains the **posted data**.
44 |
45 |
46 | ## Usage
47 |
48 | With the configuration setup, and your event handlers in place, you'll have the custom data stored in database. To display the data you can simply call the relation you setup in the configuration as a *method*.
49 |
50 | ``` .language-php
51 | $page->yourRelation()->custom_field
52 | ```
53 |
--------------------------------------------------------------------------------
/v4/page-module/custom-fields.md:
--------------------------------------------------------------------------------
1 | title: Custom Fields
2 | subtitle: Page Module
3 | -------
4 |
5 | - [Configuration](#configuration)
6 | - [Hooking in events](#events)
7 | - [Usage](#usage)
8 |
9 | It is often required to add more fields to a page than the default provided ones. For this reason you can add any type of custom field to the Page Module.
10 |
11 | For an in-depth overview you can watch the following video on [adding custom fields to the page module](https://www.youtube.com/watch?v=HpzYIWOdzv8).
12 |
13 |
14 | ## Configuration
15 |
16 |
17 | ### Defining the fields
18 |
19 | In the Page module config file located at `Config/asgard.page.config.php` you'll see the following configuration options:
20 |
21 | ``` .language-php
22 | 'partials' => [
23 | 'translatable' => [
24 | 'create' => [],
25 | 'edit' => [],
26 | ],
27 | 'normal' => [
28 | 'create' => [],
29 | 'edit' => [],
30 | ],
31 | ],
32 | ```
33 |
34 | In these arrays you can give on array of fields for translatable fields (create & edit) and non translatable fields (create & edit). Those will be shown on the page create and edit views.
35 |
36 |
37 | ### Defining the relation
38 |
39 | In that same config file you'll also see a `relations` key, just as with the User module, you can add dynamic relations with the Page entity. This will mostly be with your custom module that will have the entity with the additional data to be stored
40 |
41 | ## Events
42 |
43 | The way to 'intercept' the posted data, is by hooking into the `PageWasCreated` and `PageWasUpdated` events. These events both have the `pageId` (int) and `data` (array). The `data` contains the **posted data**.
44 |
45 |
46 | ## Usage
47 |
48 | With the configuration setup, and your event handlers in place, you'll have the custom data stored in database. To display the data you can simply call the relation you setup in the configuration as a *method*.
49 |
50 | ``` .language-php
51 | $page->yourRelation()->custom_field
52 | ```
53 |
--------------------------------------------------------------------------------
/v1/page-module/custom-fields.md:
--------------------------------------------------------------------------------
1 | title: Custom Fields
2 | subtitle: Page Module
3 | -------
4 |
5 | - [Configuration](#configuration)
6 | - [Hooking in events](#events)
7 | - [Usage](#usage)
8 |
9 | It is often required to add more fields to a page than the default provided ones. For this reason you can add any type of custom field to the Page Module.
10 |
11 | For an in-depth overview you can watch the following video on [adding custom fields to the page module](https://www.youtube.com/watch?v=HpzYIWOdzv8).
12 |
13 |
14 | ## Configuration
15 |
16 |
17 | ### Defining the fields
18 |
19 | In the Page module config file located at `Config/asgard.page.config.php` you'll see the following configuration options:
20 |
21 | ``` .language-php
22 | 'partials' => [
23 | 'translatable' => [
24 | 'create' => [],
25 | 'edit' => [],
26 | ],
27 | 'normal' => [
28 | 'create' => [],
29 | 'edit' => [],
30 | ],
31 | ],
32 | ```
33 |
34 | In these arrays you can give on array of fields for translatable fields (create & edit) and non translatable fields (create & edit). Those will be shown on the page create and edit views.
35 |
36 |
37 | ### Defining the relation
38 |
39 | In that same config file you'll also see a `relations` key, just as with the User module, you can add dynamic relations with the Page entity. This will mostly be with your custom module that will have the entity with the additional data to be stored
40 |
41 | ## Events
42 |
43 | The way to 'intercept' the posted data, is by hooking into the `PageWasCreated` and `PageWasUpdated` events. These events both have the `pageId` (int) and `data` (array). The `data` contains the **posted data**.
44 |
45 |
46 | ## Usage
47 |
48 | With the configuration setup, and your event handlers in place, you'll have the custom data stored in database. To display the data you can simply call the relation you setup in the configuration as a *method*.
49 |
50 | ``` .language-php
51 | $page->yourRelation()->custom_field
52 | ```
53 |
--------------------------------------------------------------------------------
/v1/user-module/configuration.md:
--------------------------------------------------------------------------------
1 | title: Configuration
2 | subtitle: User Module
3 | -------
4 |
5 | - [Adding data on the users table](#adding-data-on-users-table)
6 | - [Changing login columns](#changing-login-column)
7 | - [Changing redirect route after login](#changing-redirect-route-after-login)
8 | - [User driver](#user-driver)
9 |
10 | The **User module** configuration file can be found at `config/asgard.user.users.php`.
11 |
12 | ## Adding data on the users table
13 |
14 | You can add additional columns on the users table if that's really needed. For instance if you want to have an username.
15 |
16 | This defaults to the following fields:
17 |
18 | ``` .language-php
19 | 'fillable' => [
20 | 'email',
21 | 'password',
22 | 'permissions',
23 | 'first_name',
24 | 'last_name',
25 | ],
26 | ```
27 |
28 | ## Changing login columns
29 |
30 | On the **Sentinel user driver**, you can choose which columns you would like to use as login attribute. By default this uses the *email* column.
31 |
32 | ``` .language-php
33 | 'login-columns' => ['email'],
34 | ```
35 |
36 | You'll notice this is an array, indeed Sentinel allows multiple possible login columns.
37 |
38 |
39 | ## Changing redirect route after login
40 |
41 | Define which route to redirect to after a successful login.
42 |
43 | This defaults to the `homepage` route.
44 |
45 | ``` .language-php
46 | 'redirect_route_after_login' => 'homepage',
47 | ```
48 |
49 | ## User driver
50 |
51 | Define which user driver to use.
52 |
53 | It defaults to **Sentinel**.
54 |
55 | ``` .language-php
56 | 'driver' => 'Sentinel',
57 | ```
58 |
59 | Make sure to install the wanted driver on composer first.
60 |
61 | Also, be sure to check out the [User Drivers](https://asgardcms.com/en/docs/user-module/drivers) documentation page for additional info on how to create new user & role drivers.
62 |
63 |
--------------------------------------------------------------------------------
/v1/setting-module/adding-settings.md:
--------------------------------------------------------------------------------
1 | title: Adding settings
2 | subtitle: Setting Module
3 | -------
4 |
5 | - [Registering translatable settings](#registering-translatable-settings)
6 | - [Registering plain settings](#registering-plain-settings)
7 |
8 | Adding settings for you module is very easy. All you need to do is add a `settings.php` configuration file in `YourModule/config/settings.php`, and return an array of settings you want.
9 |
10 | ### Registering translatable settings
11 |
12 | The settings are registered in the following manner:
13 |
14 |
15 | ``` .language-php
16 |
17 | return [
18 | 'posts-per-page' => [
19 | 'description' => trans('blog::settings.posts-per-page'),
20 | 'view' => 'text',
21 | 'translatable' => true,
22 | 'default' => 15,
23 | ],
24 | 'this-is-a-checkbox' => [
25 | 'description' => 'This is a checkbox',
26 | 'view' => 'checkbox',
27 | 'translatable' => true,
28 | ],
29 | 'this-is-a-textarea' => [
30 | 'description' => 'This is a textarea',
31 | 'view' => 'textarea',
32 | 'translatable' => true,
33 | ],
34 | ];
35 |
36 | ```
37 |
38 | The **array key** being the setting name, holding an array of information.
39 |
40 | The information array needs the following:
41 |
42 | - a `description` key: this will be the label / placeholder,
43 | - a `view` key: which points to the view holding the field,
44 | - a `translatable` key: defines if the setting is translatable (set in multiple languages)
45 | - a `default` key (*optional*): defines a default value for your setting if none is present and none is set in the third argument of `Setting::get()`.
46 |
47 |
48 | ### Registering Plain settings
49 |
50 | Not every setting has to be translatable, plain settings are settings that aren't translated.
51 |
52 | ``` .language-php
53 | 'plain-non-translated-setting' => [
54 | 'description' => 'A plain setting',
55 | 'view' => 'text',
56 | 'default' => 'your default value',
57 | ],
58 | ```
59 |
--------------------------------------------------------------------------------
/v2/user-module/drivers.md:
--------------------------------------------------------------------------------
1 | title: Drivers
2 | subtitle: User Module
3 | -------
4 |
5 | - [User and Role providers](#user-and-role-providers)
6 | - [Implementing custom providers](#implementing-custom-providers)
7 |
8 |
9 | The user module brings three important interfaces:
10 |
11 | - `Authentication` ([view interface](https://github.com/AsgardCms/User/blob/2.0/Contracts/Authentication.php))
12 | - `UserRepository` ([view interface](https://github.com/AsgardCms/User/blob/2.0/Repositories/UserRepository.php))
13 | - `RoleRepository` ([view interface](https://github.com/AsgardCms/User/blob/2.0/Repositories/RoleRepository.php))
14 |
15 | Thanks to these interface, the user and role systems can be completely decoupled from the implementation. This is what enables AsgardCMS to give you the option to either use Sentry or Sentinel out of the box.
16 |
17 | ## User and Role providers
18 |
19 | AsgardCMS comes **out of the box** with the following User and Role providers:
20 |
21 | - [Cartalyst Sentinel](https://cartalyst.com/manual/sentinel/1.0?utm_source=asgard-cms&utm_medium=readme&utm_campaign=asgard-cms)
22 |
23 | ## Implementing custom providers
24 |
25 | You are absolutely free to implement other user/role/authentication providers. You could for instance make an implementation for the popular packages Confide and Entrust, or maybe you're satisfied with the basic laravel implementation.
26 |
27 | To make a new implementation its very easy, you simply need to implement the said interfaces and place the implementation in the `Repositories/` folder.
28 |
29 | For your inspiration you can check how Sentry and Sentinel are implemented:
30 |
31 | - [Sentinel](https://github.com/AsgardCms/User/tree/master/Repositories/Sentinel)
32 |
33 | Once implemented, don't forget to change the `UserServiceProvider` class to bind the interfaces to your implementation. You can do this in the [registerBindings()](https://github.com/AsgardCms/User/blob/master/Providers/UserServiceProvider.php#L75) method.
34 |
35 | For the spirit of open source, if you have successfully implemented another driver, consider sending a pull-request to the User Module repository so others can benefit from your hard work too.
36 |
37 |
--------------------------------------------------------------------------------
/v3/user-module/drivers.md:
--------------------------------------------------------------------------------
1 | title: Drivers
2 | subtitle: User Module
3 | -------
4 |
5 | - [User and Role providers](#user-and-role-providers)
6 | - [Implementing custom providers](#implementing-custom-providers)
7 |
8 |
9 | The user module brings three important interfaces:
10 |
11 | - `Authentication` ([view interface](https://github.com/AsgardCms/User/blob/2.0/Contracts/Authentication.php))
12 | - `UserRepository` ([view interface](https://github.com/AsgardCms/User/blob/2.0/Repositories/UserRepository.php))
13 | - `RoleRepository` ([view interface](https://github.com/AsgardCms/User/blob/2.0/Repositories/RoleRepository.php))
14 |
15 | Thanks to these interface, the user and role systems can be completely decoupled from the implementation. This is what enables AsgardCMS to give you the option to either use Sentry or Sentinel out of the box.
16 |
17 | ## User and Role providers
18 |
19 | AsgardCMS comes **out of the box** with the following User and Role providers:
20 |
21 | - [Cartalyst Sentinel](https://cartalyst.com/manual/sentinel/1.0?utm_source=asgard-cms&utm_medium=readme&utm_campaign=asgard-cms)
22 |
23 | ## Implementing custom providers
24 |
25 | You are absolutely free to implement other user/role/authentication providers. You could for instance make an implementation for the popular packages Confide and Entrust, or maybe you're satisfied with the basic laravel implementation.
26 |
27 | To make a new implementation its very easy, you simply need to implement the said interfaces and place the implementation in the `Repositories/` folder.
28 |
29 | For your inspiration you can check how Sentry and Sentinel are implemented:
30 |
31 | - [Sentinel](https://github.com/AsgardCms/User/tree/master/Repositories/Sentinel)
32 |
33 | Once implemented, don't forget to change the `UserServiceProvider` class to bind the interfaces to your implementation. You can do this in the [registerBindings()](https://github.com/AsgardCms/User/blob/master/Providers/UserServiceProvider.php#L75) method.
34 |
35 | For the spirit of open source, if you have successfully implemented another driver, consider sending a pull-request to the User Module repository so others can benefit from your hard work too.
36 |
37 |
--------------------------------------------------------------------------------
/v4/user-module/drivers.md:
--------------------------------------------------------------------------------
1 | title: Drivers
2 | subtitle: User Module
3 | -------
4 |
5 | - [User and Role providers](#user-and-role-providers)
6 | - [Implementing custom providers](#implementing-custom-providers)
7 |
8 |
9 | The user module brings three important interfaces:
10 |
11 | - `Authentication` ([view interface](https://github.com/AsgardCms/User/blob/2.0/Contracts/Authentication.php))
12 | - `UserRepository` ([view interface](https://github.com/AsgardCms/User/blob/2.0/Repositories/UserRepository.php))
13 | - `RoleRepository` ([view interface](https://github.com/AsgardCms/User/blob/2.0/Repositories/RoleRepository.php))
14 |
15 | Thanks to these interface, the user and role systems can be completely decoupled from the implementation. This is what enables AsgardCMS to give you the option to either use Sentry or Sentinel out of the box.
16 |
17 | ## User and Role providers
18 |
19 | AsgardCMS comes **out of the box** with the following User and Role providers:
20 |
21 | - [Cartalyst Sentinel](https://cartalyst.com/manual/sentinel/1.0?utm_source=asgard-cms&utm_medium=readme&utm_campaign=asgard-cms)
22 |
23 | ## Implementing custom providers
24 |
25 | You are absolutely free to implement other user/role/authentication providers. You could for instance make an implementation for the popular packages Confide and Entrust, or maybe you're satisfied with the basic laravel implementation.
26 |
27 | To make a new implementation its very easy, you simply need to implement the said interfaces and place the implementation in the `Repositories/` folder.
28 |
29 | For your inspiration you can check how Sentry and Sentinel are implemented:
30 |
31 | - [Sentinel](https://github.com/AsgardCms/User/tree/master/Repositories/Sentinel)
32 |
33 | Once implemented, don't forget to change the `UserServiceProvider` class to bind the interfaces to your implementation. You can do this in the [registerBindings()](https://github.com/AsgardCms/User/blob/master/Providers/UserServiceProvider.php#L75) method.
34 |
35 | For the spirit of open source, if you have successfully implemented another driver, consider sending a pull-request to the User Module repository so others can benefit from your hard work too.
36 |
37 |
--------------------------------------------------------------------------------
/v1/core-module/permissions.md:
--------------------------------------------------------------------------------
1 | title: Permissions
2 | subtitle: Core Module
3 | -------
4 |
5 | - [Introduction](#introduction)
6 | - [Usage](#usage)
7 | - [Authentication Contract](#authentication-contract)
8 |
9 | ### Introduction
10 |
11 | In the same way the core listens for navigation items, it also listens for permissions. Your module can push the permissions it needs.
12 |
13 | ### Usage
14 |
15 | All you have to do is have a `permissions.php` file in the modules Config file. This file will contain the permissions for your module.
16 |
17 | Each module can define its permissions per *category*, prefixed by the singular module name. Take for instance the blog module:
18 |
19 | ``` .language-php
20 | [
24 | 'index',
25 | 'create',
26 | 'store',
27 | 'edit',
28 | 'update',
29 | 'destroy'
30 | ],
31 | 'blog.categories' => [
32 | 'index',
33 | 'create',
34 | 'store',
35 | 'edit',
36 | 'update',
37 | 'destroy'
38 | ],
39 | 'blog.tags' => [
40 | 'index',
41 | 'create',
42 | 'store',
43 | 'edit',
44 | 'update',
45 | 'destroy'
46 | ],
47 | ];
48 |
49 | ```
50 |
51 | That is all, the Core Module will loop over every configuration file and load them.
52 |
53 | ### Authentication contract
54 |
55 | Once you've setup the appropriate roles with their permissions, you can start checking for them in controllers, views etc.
56 |
57 | Do perform this action you can inject the [authentication contract](https://github.com/nWidart-Modules/Core/blob/master/Contracts/Authentication.php) which has a `hasAccess()` method. It has the following signature:
58 |
59 | ``` .language-php
60 | /**
61 | * Determines if the current user has access to given permission
62 | * @param $permission
63 | * @return bool
64 | */
65 | public function hasAccess($permission);
66 | ```
67 |
68 | An example, to check if a user has access to the users index page in the administration:
69 |
70 | ``` .language-php
71 | $this->auth->hasAccess('users.index');
72 | ```
73 |
74 | Which will return a boolean.
75 |
--------------------------------------------------------------------------------
/v1/user-module/drivers.md:
--------------------------------------------------------------------------------
1 | title: Drivers
2 | subtitle: User Module
3 | -------
4 |
5 | - [User and Role providers](#user-and-role-providers)
6 | - [Implementing custom providers](#implementing-custom-providers)
7 |
8 |
9 | The user module brings three important interfaces:
10 |
11 | - `Authentication` ([view interface](https://github.com/AsgardCms/Core/blob/master/Contracts/Authentication.php))
12 | - `UserRepository` ([view interface](https://github.com/AsgardCms/User/blob/master/Repositories/UserRepository.php))
13 | - `RoleRepository` ([view interface](https://github.com/AsgardCms/User/blob/master/Repositories/RoleRepository.php))
14 |
15 | Thanks to these interface, the user and role systems can be completely decoupled from the implementation. This is what enables AsgardCMS to give you the option to either use Sentry or Sentinel out of the box.
16 |
17 | ## User and Role providers
18 |
19 | AsgardCMS comes **out of the box** with the following User and Role providers:
20 |
21 | - [Cartalyst Sentinel](https://cartalyst.com/manual/sentinel/1.0?utm_source=asgard-cms&utm_medium=readme&utm_campaign=asgard-cms)
22 |
23 | ## Implementing custom providers
24 |
25 | You are absolutely free to implement other user/role/authentication providers. You could for instance make an implementation for the popular packages Confide and Entrust, or maybe you're satisfied with the basic laravel implementation.
26 |
27 | To make a new implementation its very easy, you simply need to implement the said interfaces and place the implementation in the `Repositories/` folder.
28 |
29 | For your inspiration you can check how Sentry and Sentinel are implemented:
30 |
31 | - [Sentinel](https://github.com/AsgardCms/User/tree/master/Repositories/Sentinel)
32 |
33 | Once implemented, don't forget to change the `UserServiceProvider` class to bind the interfaces to your implementation. You can do this in the [registerBindings()](https://github.com/AsgardCms/User/blob/master/Providers/UserServiceProvider.php#L75) method.
34 |
35 | For the spirit of open source, if you have successfully implemented another driver, consider sending a pull-request to the User Module repository so others can benefit from your hard work too.
36 |
37 |
--------------------------------------------------------------------------------
/v2/page-module/page-hooks.md:
--------------------------------------------------------------------------------
1 | title: Page Hooks
2 | subtitle: Page Module
3 | -------
4 |
5 | The page module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [PageIsCreating](#page-is-creating)
8 | - [PageIsUpdating](#page-is-updating)
9 | - [ContentIsRendering](#content-is-rendering)
10 |
11 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
12 |
13 | ## PageIsCreating
14 |
15 |
16 | ## PageIsUpdating
17 |
18 | The `PageIsUpdating` has one more method:
19 |
20 | - `getPage()`: Will return the page being updated
21 |
22 |
23 | ### PageIsUpdating Example
24 |
25 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
26 |
27 | Lets say you want to upper case the page titles:
28 |
29 | ```.language-php
30 | Event::listen(PageIsUpdating::class, function (PageIsUpdating $event) {
31 | $attributes = [
32 | 'en' => ['title' => strtoupper($this->getAttributes('en.title'))]
33 | 'fr' => ['title' => strtoupper($this->getAttributes('fr.title'))]
34 | ];
35 | $event->setAttributes($attributes);
36 | });
37 | ```
38 |
39 | ## ContentIsRendering
40 |
41 | This hook is used in the body Accessor of a page. Every time you'll call `$page->body` this hook will be triggered. You can still use `->getOriginal('body')` on the PageTranslation entity like any laravel model to bypass this accessor.
42 |
43 | Available methods:
44 |
45 | - `getBody()`: Will return the current body content
46 | - `setBody('')`: Sets the body element
47 | - `getOriginal()`: Get the original body without any changes by other listeners
48 |
49 | You could use this hook to add short codes to your page body section for example.
50 |
51 | ### ContentIsRendering Example
52 |
53 | ```.language-php
54 | Event::listen(ContentIsRendering::class, function (ContentIsRendering $event) {
55 | $content = str_replace('[shortcode]', 'My Awesome Code', $event->getBody();
56 | $event->setBody($content);
57 | });
58 | ```
59 |
--------------------------------------------------------------------------------
/v3/page-module/page-hooks.md:
--------------------------------------------------------------------------------
1 | title: Page Hooks
2 | subtitle: Page Module
3 | -------
4 |
5 | The page module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [PageIsCreating](#page-is-creating)
8 | - [PageIsUpdating](#page-is-updating)
9 | - [ContentIsRendering](#content-is-rendering)
10 |
11 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
12 |
13 | ## PageIsCreating
14 |
15 |
16 | ## PageIsUpdating
17 |
18 | The `PageIsUpdating` has one more method:
19 |
20 | - `getPage()`: Will return the page being updated
21 |
22 |
23 | ### PageIsUpdating Example
24 |
25 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
26 |
27 | Lets say you want to upper case the page titles:
28 |
29 | ```.language-php
30 | Event::listen(PageIsUpdating::class, function (PageIsUpdating $event) {
31 | $attributes = [
32 | 'en' => ['title' => strtoupper($this->getAttributes('en.title'))]
33 | 'fr' => ['title' => strtoupper($this->getAttributes('fr.title'))]
34 | ];
35 | $event->setAttributes($attributes);
36 | });
37 | ```
38 |
39 | ## ContentIsRendering
40 |
41 | This hook is used in the body Accessor of a page. Every time you'll call `$page->body` this hook will be triggered. You can still use `->getOriginal('body')` on the PageTranslation entity like any laravel model to bypass this accessor.
42 |
43 | Available methods:
44 |
45 | - `getBody()`: Will return the current body content
46 | - `setBody('')`: Sets the body element
47 | - `getOriginal()`: Get the original body without any changes by other listeners
48 |
49 | You could use this hook to add short codes to your page body section for example.
50 |
51 | ### ContentIsRendering Example
52 |
53 | ```.language-php
54 | Event::listen(ContentIsRendering::class, function (ContentIsRendering $event) {
55 | $content = str_replace('[shortcode]', 'My Awesome Code', $event->getBody();
56 | $event->setBody($content);
57 | });
58 | ```
59 |
--------------------------------------------------------------------------------
/v4/page-module/page-hooks.md:
--------------------------------------------------------------------------------
1 | title: Page Hooks
2 | subtitle: Page Module
3 | -------
4 |
5 | The page module comes with the following hooks. You can hook into those using the usual listener logic.
6 |
7 | - [PageIsCreating](#page-is-creating)
8 | - [PageIsUpdating](#page-is-updating)
9 | - [ContentIsRendering](#content-is-rendering)
10 |
11 | [Please view the hook section in the Core module.](/docs/v2/core-module/hooks)
12 |
13 | ## PageIsCreating
14 |
15 |
16 | ## PageIsUpdating
17 |
18 | The `PageIsUpdating` has one more method:
19 |
20 | - `getPage()`: Will return the page being updated
21 |
22 |
23 | ### PageIsUpdating Example
24 |
25 | To keep the example simple we're going to use an inline listener using a closure instead of a full class.
26 |
27 | Lets say you want to upper case the page titles:
28 |
29 | ```.language-php
30 | Event::listen(PageIsUpdating::class, function (PageIsUpdating $event) {
31 | $attributes = [
32 | 'en' => ['title' => strtoupper($this->getAttributes('en.title'))]
33 | 'fr' => ['title' => strtoupper($this->getAttributes('fr.title'))]
34 | ];
35 | $event->setAttributes($attributes);
36 | });
37 | ```
38 |
39 | ## ContentIsRendering
40 |
41 | This hook is used in the body Accessor of a page. Every time you'll call `$page->body` this hook will be triggered. You can still use `->getOriginal('body')` on the PageTranslation entity like any laravel model to bypass this accessor.
42 |
43 | Available methods:
44 |
45 | - `getBody()`: Will return the current body content
46 | - `setBody('')`: Sets the body element
47 | - `getOriginal()`: Get the original body without any changes by other listeners
48 |
49 | You could use this hook to add short codes to your page body section for example.
50 |
51 | ### ContentIsRendering Example
52 |
53 | ```.language-php
54 | Event::listen(ContentIsRendering::class, function (ContentIsRendering $event) {
55 | $content = str_replace('[shortcode]', 'My Awesome Code', $event->getBody();
56 | $event->setBody($content);
57 | });
58 | ```
59 |
--------------------------------------------------------------------------------
/v1/setting-module/reading-settings.md:
--------------------------------------------------------------------------------
1 | title: Reading settings
2 | subtitle: Setting Module
3 | -------
4 |
5 | - [Injecting the interface](#injecting-the-interface)
6 | - [Using the interface](#using-the-interface)
7 | - [Get setting in current locale](#get-setting-in-current-locale)
8 | - [Get a non translatable setting](get-a-non-translatable-setting)
9 | - [Using the helper function](#using-the-helper-function)
10 | - [Using the facade](#using-the-facade)
11 |
12 | ## Injecting the interface
13 |
14 | To use a setting you can inject the [setting interface](https://github.com/nWidart-Modules/Core/blob/master/Contracts/Setting.php) into your method/constructor.
15 |
16 | ``` .language-php
17 | use Modules\Core\Contracts\Setting;
18 |
19 | ...
20 |
21 | /**
22 | * @var Setting
23 | */
24 | private $setting;
25 |
26 | public function __construct(Setting $setting)
27 | {
28 | $this->setting = $setting;
29 | }
30 | ```
31 |
32 | ## Using the interface
33 |
34 | Once this is done you can use the interface to get a setting, in a given locale.
35 | Since settings can be translatable or not, you can optionally specify the language.
36 |
37 | ### Get setting in current locale
38 |
39 | ``` .language-php
40 | $siteName = $this->setting->get('core::site-name', locale())
41 | ```
42 |
43 | ### Get a non translatable setting
44 |
45 | ``` .language-php
46 | $postsPerPage = $this->setting->get('blog::posts-per-page');
47 | ```
48 |
49 | ## Using the helper function
50 |
51 | In your views you can directly use the `setting()` function.
52 |
53 | To get the site name setting in the core module:
54 |
55 | ``` .language-php
56 | {{ setting('core::site-name') }}
57 | ```
58 |
59 |
60 | ## Using the facade
61 |
62 | **Depreciated.**
63 |
64 | In views you can use the `Setting` facade with the `get()` method.
65 |
66 | To get the site name setting in the core module:
67 |
68 | ``` .language-php
69 | {{ Setting::get('core::site-name') }}
70 | ```
71 |
--------------------------------------------------------------------------------
/v2/dashboard-module/widgets.md:
--------------------------------------------------------------------------------
1 | title: Widgets
2 | subtitle: Dashboard Module
3 | -------
4 |
5 | - [Defining widgets](#defining-widgets)
6 |
7 | The dashboard is a very important part of the back-end of the CMS. It's the first thing your client will see when he logs into the backend. In asgard, your modules can define a set of widgets that will be displayed on the dashboard. These widgets can be simple counts, tables, or pretty much whatever you want.
8 |
9 | Widgets location are saved on a per user basis. Each logged in user with the correct permissions can re-arrange the widgets however he or she prefers.
10 |
11 | ## Defining widgets
12 |
13 | Creating widgets is very easy and straightforward. A widget is composed of the following parts:
14 |
15 | - A widget class
16 | - A widget view
17 |
18 | ### Widget class
19 |
20 | First you'll have to create a widget class that extends an abstract class: `BaseWidget`. This BaseWidget class will enforce you to implement the following methods:
21 |
22 | - name (*string*): The name of the module. This needs to be on word. You can either choose to use camelCase, snake_case, or whatever you prefer as long as this is **one word**.
23 | - options (*array*): This is an array of options that your widget can have.
24 |
25 | Possible options are:
26 |
27 | - x
28 | - y
29 | - width
30 | - height
31 |
32 | - view (*string*): Define which view needs to be used for you widget
33 | - data (*array*): Choose what data to send to your view. The array keys will be available in the view, just like a regular `view::make`.
34 |
35 | [View an example widget class.](https://github.com/AsgardCms/Blog/blob/master/Widgets/PostsWidget.php)
36 |
37 | ### Widget view
38 |
39 | Now you can make your widget view. You can find some inspiration on the widgets page of the [Admin LTE theme](https://almsaeedstudio.com/themes/AdminLTE/pages/widgets.html).
40 |
41 |
42 | ### Registering the widget
43 |
44 | As a final step you need to define your active widgets. To do so, you need to add a `Widgets` array in your `module.json` file, with an array of widget classes.
45 |
46 | For instance, the Blog module has:
47 |
48 | ``` .language-javascript
49 | "widgets": [
50 | "Modules\\Blog\\Widgets\\PostsWidget",
51 | "Modules\\Blog\\Widgets\\CategoriesWidget",
52 | "Modules\\Blog\\Widgets\\LatestPostsWidget"
53 | ],
54 | ```
55 |
56 | Your widget will now be displayed on the dashboard.
57 |
58 |
--------------------------------------------------------------------------------
/v3/dashboard-module/widgets.md:
--------------------------------------------------------------------------------
1 | title: Widgets
2 | subtitle: Dashboard Module
3 | -------
4 |
5 | - [Defining widgets](#defining-widgets)
6 |
7 | The dashboard is a very important part of the back-end of the CMS. It's the first thing your client will see when he logs into the backend. In asgard, your modules can define a set of widgets that will be displayed on the dashboard. These widgets can be simple counts, tables, or pretty much whatever you want.
8 |
9 | Widgets location are saved on a per user basis. Each logged in user with the correct permissions can re-arrange the widgets however he or she prefers.
10 |
11 | ## Defining widgets
12 |
13 | Creating widgets is very easy and straightforward. A widget is composed of the following parts:
14 |
15 | - A widget class
16 | - A widget view
17 |
18 | ### Widget class
19 |
20 | First you'll have to create a widget class that extends an abstract class: `BaseWidget`. This BaseWidget class will enforce you to implement the following methods:
21 |
22 | - name (*string*): The name of the module. This needs to be on word. You can either choose to use camelCase, snake_case, or whatever you prefer as long as this is **one word**.
23 | - options (*array*): This is an array of options that your widget can have.
24 |
25 | Possible options are:
26 |
27 | - x
28 | - y
29 | - width
30 | - height
31 |
32 | - view (*string*): Define which view needs to be used for you widget
33 | - data (*array*): Choose what data to send to your view. The array keys will be available in the view, just like a regular `view::make`.
34 |
35 | [View an example widget class.](https://github.com/AsgardCms/Blog/blob/master/Widgets/PostsWidget.php)
36 |
37 | ### Widget view
38 |
39 | Now you can make your widget view. You can find some inspiration on the widgets page of the [Admin LTE theme](https://almsaeedstudio.com/themes/AdminLTE/pages/widgets.html).
40 |
41 |
42 | ### Registering the widget
43 |
44 | As a final step you need to define your active widgets. To do so, you need to add a `Widgets` array in your `module.json` file, with an array of widget classes.
45 |
46 | For instance, the Blog module has:
47 |
48 | ``` .language-javascript
49 | "widgets": [
50 | "Modules\\Blog\\Widgets\\PostsWidget",
51 | "Modules\\Blog\\Widgets\\CategoriesWidget",
52 | "Modules\\Blog\\Widgets\\LatestPostsWidget"
53 | ],
54 | ```
55 |
56 | Your widget will now be displayed on the dashboard.
57 |
58 |
--------------------------------------------------------------------------------
/v4/dashboard-module/widgets.md:
--------------------------------------------------------------------------------
1 | title: Widgets
2 | subtitle: Dashboard Module
3 | -------
4 |
5 | - [Defining widgets](#defining-widgets)
6 |
7 | The dashboard is a very important part of the back-end of the CMS. It's the first thing your client will see when he logs into the backend. In asgard, your modules can define a set of widgets that will be displayed on the dashboard. These widgets can be simple counts, tables, or pretty much whatever you want.
8 |
9 | Widgets location are saved on a per user basis. Each logged in user with the correct permissions can re-arrange the widgets however he or she prefers.
10 |
11 | ## Defining widgets
12 |
13 | Creating widgets is very easy and straightforward. A widget is composed of the following parts:
14 |
15 | - A widget class
16 | - A widget view
17 |
18 | ### Widget class
19 |
20 | First you'll have to create a widget class that extends an abstract class: `BaseWidget`. This BaseWidget class will enforce you to implement the following methods:
21 |
22 | - name (*string*): The name of the module. This needs to be on word. You can either choose to use camelCase, snake_case, or whatever you prefer as long as this is **one word**.
23 | - options (*array*): This is an array of options that your widget can have.
24 |
25 | Possible options are:
26 |
27 | - x
28 | - y
29 | - width
30 | - height
31 |
32 | - view (*string*): Define which view needs to be used for you widget
33 | - data (*array*): Choose what data to send to your view. The array keys will be available in the view, just like a regular `view::make`.
34 |
35 | [View an example widget class.](https://github.com/AsgardCms/Blog/blob/master/Widgets/PostsWidget.php)
36 |
37 | ### Widget view
38 |
39 | Now you can make your widget view. You can find some inspiration on the widgets page of the [Admin LTE theme](https://almsaeedstudio.com/themes/AdminLTE/pages/widgets.html).
40 |
41 |
42 | ### Registering the widget
43 |
44 | As a final step you need to define your active widgets. To do so, you need to add a `Widgets` array in your `module.json` file, with an array of widget classes.
45 |
46 | For instance, the Blog module has:
47 |
48 | ``` .language-javascript
49 | "widgets": [
50 | "Modules\\Blog\\Widgets\\PostsWidget",
51 | "Modules\\Blog\\Widgets\\CategoriesWidget",
52 | "Modules\\Blog\\Widgets\\LatestPostsWidget"
53 | ],
54 | ```
55 |
56 | Your widget will now be displayed on the dashboard.
57 |
58 |
--------------------------------------------------------------------------------
/v1/dashboard-module/widgets.md:
--------------------------------------------------------------------------------
1 | title: Widgets
2 | subtitle: Dashboard Module
3 | -------
4 |
5 | - [Defining widgets](#defining-widgets)
6 |
7 | The dashboard is a very important part of the back-end of the CMS. It's the first thing your client will see when he logs into the backend. In asgard, your modules can define a set of widgets that will be displayed on the dashboard. These widgets can be simple counts, tables, or pretty much whatever you want.
8 |
9 | Widgets location are saved on a per user basis. Each logged in user with the correct permissions can re-arrange the widgets however he or she prefers.
10 |
11 | ### Defining widgets
12 |
13 | Creating widgets is very easy and straightforward. A widget is composed of the following parts:
14 |
15 | - A widget class
16 | - A widget view
17 |
18 | #### Widget class
19 |
20 | First you'll have to create a widget class that extends an abstract class: `BaseWidget`. This BaseWidget class will enforce you to implement the following methods:
21 |
22 | - name (*string*): The name of the module. This needs to be on word. You can either choose to use camelCase, snake_case, or whatever you prefer as long as this is **one word**.
23 | - options (*array*): This is an array of options that your widget can have.
24 |
25 | Possible options are:
26 |
27 | - x
28 | - y
29 | - width
30 | - height
31 |
32 | - view (*string*): Define which view needs to be used for you widget
33 | - data (*array*): Choose what data to send to your view. The array keys will be available in the view, just like a regular `view::make`.
34 |
35 | [View an example widget class.](https://github.com/AsgardCms/Blog/blob/master/Widgets/PostsWidget.php)
36 |
37 | #### Widget view
38 |
39 | Now you can make your widget view. You can find some inspiration on the widgets page of the [Admin LTE theme](https://almsaeedstudio.com/themes/AdminLTE/pages/widgets.html).
40 |
41 |
42 | #### Registering the widget
43 |
44 | As a final step you need to define your active widgets. To do so, you need to add a `Widgets` array in your `module.json` file, with an array of widget classes.
45 |
46 | For instance, the Blog module has:
47 |
48 | ``` .language-javascript
49 | "widgets": [
50 | "Modules\\Blog\\Widgets\\PostsWidget",
51 | "Modules\\Blog\\Widgets\\CategoriesWidget",
52 | "Modules\\Blog\\Widgets\\LatestPostsWidget"
53 | ],
54 | ```
55 |
56 | Your widget will now be displayed on the dashboard.
57 |
58 |
--------------------------------------------------------------------------------
/v2/setting-module/adding-settings.md:
--------------------------------------------------------------------------------
1 | title: Adding settings
2 | subtitle: Setting Module
3 | -------
4 |
5 | - [Registering translatable settings](#registering-translatable-settings)
6 | - [Registering plain settings](#registering-plain-settings)
7 |
8 | Adding settings for you module is very easy. All you need to do is add a `settings.php` configuration file in `YourModule/config/settings.php`, and return an array of settings you want.
9 |
10 | You will also have to load that setting file in your service provider, like so:
11 |
12 | ```.language-php
13 | $this->publishConfig('moduleName', 'permissions');
14 | ```
15 | The first argument is the **module name** and the second the **file name** without extension.
16 |
17 | ## Registering translatable settings
18 |
19 | The settings are registered in the following manner:
20 |
21 |
22 | ``` .language-php
23 |
24 | return [
25 | 'posts-per-page' => [
26 | 'description' => trans('blog::settings.posts-per-page'),
27 | 'view' => 'text',
28 | 'translatable' => true,
29 | 'default' => 15,
30 | ],
31 | 'this-is-a-checkbox' => [
32 | 'description' => 'This is a checkbox',
33 | 'view' => 'checkbox',
34 | 'translatable' => true,
35 | ],
36 | 'this-is-a-textarea' => [
37 | 'description' => 'This is a textarea',
38 | 'view' => 'textarea',
39 | 'translatable' => true,
40 | ],
41 | ];
42 |
43 | ```
44 |
45 | The **array key** being the setting name, holding an array of information.
46 |
47 | The information array needs the following:
48 |
49 | - a `description` key: this will be the label / placeholder,
50 | - a `view` key: which points to the view holding the field,
51 | - a `translatable` key: defines if the setting is translatable (set in multiple languages)
52 | - a `default` key (*optional*): defines a default value for your setting if none is present and none is set in the third argument of `Setting::get()`.
53 |
54 |
55 | ## Registering Plain settings
56 |
57 | Not every setting has to be translatable, plain settings are settings that aren't translated.
58 |
59 | ``` .language-php
60 | 'plain-non-translated-setting' => [
61 | 'description' => 'A plain setting',
62 | 'view' => 'text',
63 | 'default' => 'your default value',
64 | ],
65 | ```
66 |
--------------------------------------------------------------------------------
/v3/setting-module/adding-settings.md:
--------------------------------------------------------------------------------
1 | title: Adding settings
2 | subtitle: Setting Module
3 | -------
4 |
5 | - [Registering translatable settings](#registering-translatable-settings)
6 | - [Registering plain settings](#registering-plain-settings)
7 |
8 | Adding settings for you module is very easy. All you need to do is add a `settings.php` configuration file in `YourModule/config/settings.php`, and return an array of settings you want.
9 |
10 | You will also have to load that setting file in your service provider, like so:
11 |
12 | ```.language-php
13 | $this->publishConfig('moduleName', 'permissions');
14 | ```
15 | The first argument is the **module name** and the second the **file name** without extension.
16 |
17 | ## Registering translatable settings
18 |
19 | The settings are registered in the following manner:
20 |
21 |
22 | ``` .language-php
23 |
24 | return [
25 | 'posts-per-page' => [
26 | 'description' => trans('blog::settings.posts-per-page'),
27 | 'view' => 'text',
28 | 'translatable' => true,
29 | 'default' => 15,
30 | ],
31 | 'this-is-a-checkbox' => [
32 | 'description' => 'This is a checkbox',
33 | 'view' => 'checkbox',
34 | 'translatable' => true,
35 | ],
36 | 'this-is-a-textarea' => [
37 | 'description' => 'This is a textarea',
38 | 'view' => 'textarea',
39 | 'translatable' => true,
40 | ],
41 | ];
42 |
43 | ```
44 |
45 | The **array key** being the setting name, holding an array of information.
46 |
47 | The information array needs the following:
48 |
49 | - a `description` key: this will be the label / placeholder,
50 | - a `view` key: which points to the view holding the field,
51 | - a `translatable` key: defines if the setting is translatable (set in multiple languages)
52 | - a `default` key (*optional*): defines a default value for your setting if none is present and none is set in the third argument of `Setting::get()`.
53 |
54 |
55 | ## Registering Plain settings
56 |
57 | Not every setting has to be translatable, plain settings are settings that aren't translated.
58 |
59 | ``` .language-php
60 | 'plain-non-translated-setting' => [
61 | 'description' => 'A plain setting',
62 | 'view' => 'text',
63 | 'default' => 'your default value',
64 | ],
65 | ```
66 |
--------------------------------------------------------------------------------
/v4/setting-module/adding-settings.md:
--------------------------------------------------------------------------------
1 | title: Adding settings
2 | subtitle: Setting Module
3 | -------
4 |
5 | - [Registering translatable settings](#registering-translatable-settings)
6 | - [Registering plain settings](#registering-plain-settings)
7 |
8 | Adding settings for you module is very easy. All you need to do is add a `settings.php` configuration file in `YourModule/config/settings.php`, and return an array of settings you want.
9 |
10 | You will also have to load that setting file in your service provider, like so:
11 |
12 | ```.language-php
13 | $this->publishConfig('moduleName', 'permissions');
14 | ```
15 | The first argument is the **module name** and the second the **file name** without extension.
16 |
17 | ## Registering translatable settings
18 |
19 | The settings are registered in the following manner:
20 |
21 |
22 | ``` .language-php
23 |
24 | return [
25 | 'posts-per-page' => [
26 | 'description' => trans('blog::settings.posts-per-page'),
27 | 'view' => 'text',
28 | 'translatable' => true,
29 | 'default' => 15,
30 | ],
31 | 'this-is-a-checkbox' => [
32 | 'description' => 'This is a checkbox',
33 | 'view' => 'checkbox',
34 | 'translatable' => true,
35 | ],
36 | 'this-is-a-textarea' => [
37 | 'description' => 'This is a textarea',
38 | 'view' => 'textarea',
39 | 'translatable' => true,
40 | ],
41 | ];
42 |
43 | ```
44 |
45 | The **array key** being the setting name, holding an array of information.
46 |
47 | The information array needs the following:
48 |
49 | - a `description` key: this will be the label / placeholder,
50 | - a `view` key: which points to the view holding the field,
51 | - a `translatable` key: defines if the setting is translatable (set in multiple languages)
52 | - a `default` key (*optional*): defines a default value for your setting if none is present and none is set in the third argument of `Setting::get()`.
53 |
54 |
55 | ## Registering Plain settings
56 |
57 | Not every setting has to be translatable, plain settings are settings that aren't translated.
58 |
59 | ``` .language-php
60 | 'plain-non-translated-setting' => [
61 | 'description' => 'A plain setting',
62 | 'view' => 'text',
63 | 'default' => 'your default value',
64 | ],
65 | ```
66 |
--------------------------------------------------------------------------------
/v2/core-module/configuration.md:
--------------------------------------------------------------------------------
1 | title: Configuration
2 | subtitle: Core Module
3 | -------
4 |
5 | - [Admin prefix](#admin-prefix)
6 | - [Themes path](#themes-path)
7 | - [Admin theme](#admin-theme)
8 | - [AdminLTE skin](#adminlte-skin)
9 | - [Custom Ckeditor config path]($custom-ckeditor-config)
10 | - [Middleware](#middleware)
11 |
12 | This **Core Module** has one main configuration item, you'll find it at `config/asgard/core/core.php`.
13 |
14 | ## Admin Prefix
15 |
16 | With this configuration you can set how you access the admin dashboard. By default it is set to `backend`. Meaning you can access your admin dashboard on the following url `localhost:8000/backend` (if you're using the `artisan serve` command).
17 |
18 | ``` .language-php
19 | 'admin-prefix' => 'backend'
20 | ```
21 |
22 | ## Themes Path
23 |
24 | This is the location of the Themes.
25 |
26 | ``` .language-php
27 | 'themes_path' => base_path() . '/Themes',
28 | ```
29 |
30 | ## Admin theme
31 |
32 | With this setting you can change the theme used in the administration. Make sure your admin theme has the **type** set to `backend`.
33 |
34 | It defaults to `AdminLTE`.
35 |
36 |
37 | ``` .language-php
38 | 'admin-theme' => 'AdminLTE',
39 | ```
40 |
41 |
42 | ## AdminLTE skin
43 |
44 | You can customize the AdminLTE colors with this setting. The following colors are available for you to use:
45 |
46 | - skin-blue,
47 | - skin-green,
48 | - skin-black,
49 | - skin-purple,
50 | - skin-red,
51 | - skin-yellow.
52 |
53 | This defaults to the blue skin.
54 |
55 | ``` .language-php
56 | 'skin' => 'skin-blue',
57 | ```
58 |
59 |
60 | ## Custom Ckeditor Config path
61 |
62 | In case you wish to customise ckeditor and the default configuration provided doesn't suit you, you can define a custom ckeditor configuration file here. The paths needs to be relative to the `public/` directory.
63 |
64 | Example:
65 |
66 | ``` .language-php
67 | 'ckeditor-config-file-path' => '/assets/config_custom.js',
68 | ```
69 |
70 |
71 | ## Middleware
72 |
73 | Here you can add or remove middleware of different types of routes (admin, frontend and api). Add your own middleware here on their respective types.
--------------------------------------------------------------------------------
/v3/core-module/configuration.md:
--------------------------------------------------------------------------------
1 | title: Configuration
2 | subtitle: Core Module
3 | -------
4 |
5 | - [Admin prefix](#admin-prefix)
6 | - [Themes path](#themes-path)
7 | - [Admin theme](#admin-theme)
8 | - [AdminLTE skin](#adminlte-skin)
9 | - [Custom Ckeditor config path]($custom-ckeditor-config)
10 | - [Middleware](#middleware)
11 |
12 | This **Core Module** has one main configuration item, you'll find it at `config/asgard/core/core.php`.
13 |
14 | ## Admin Prefix
15 |
16 | With this configuration you can set how you access the admin dashboard. By default it is set to `backend`. Meaning you can access your admin dashboard on the following url `localhost:8000/backend` (if you're using the `artisan serve` command).
17 |
18 | ``` .language-php
19 | 'admin-prefix' => 'backend'
20 | ```
21 |
22 | ## Themes Path
23 |
24 | This is the location of the Themes.
25 |
26 | ``` .language-php
27 | 'themes_path' => base_path() . '/Themes',
28 | ```
29 |
30 | ## Admin theme
31 |
32 | With this setting you can change the theme used in the administration. Make sure your admin theme has the **type** set to `backend`.
33 |
34 | It defaults to `AdminLTE`.
35 |
36 |
37 | ``` .language-php
38 | 'admin-theme' => 'AdminLTE',
39 | ```
40 |
41 |
42 | ## AdminLTE skin
43 |
44 | You can customize the AdminLTE colors with this setting. The following colors are available for you to use:
45 |
46 | - skin-blue,
47 | - skin-green,
48 | - skin-black,
49 | - skin-purple,
50 | - skin-red,
51 | - skin-yellow.
52 |
53 | This defaults to the blue skin.
54 |
55 | ``` .language-php
56 | 'skin' => 'skin-blue',
57 | ```
58 |
59 |
60 | ## Custom Ckeditor Config path
61 |
62 | In case you wish to customise ckeditor and the default configuration provided doesn't suit you, you can define a custom ckeditor configuration file here. The paths needs to be relative to the `public/` directory.
63 |
64 | Example:
65 |
66 | ``` .language-php
67 | 'ckeditor-config-file-path' => '/assets/config_custom.js',
68 | ```
69 |
70 |
71 | ## Middleware
72 |
73 | Here you can add or remove middleware of different types of routes (admin, frontend and api). Add your own middleware here on their respective types.
--------------------------------------------------------------------------------
/v4/core-module/configuration.md:
--------------------------------------------------------------------------------
1 | title: Configuration
2 | subtitle: Core Module
3 | -------
4 |
5 | - [Admin prefix](#admin-prefix)
6 | - [Themes path](#themes-path)
7 | - [Admin theme](#admin-theme)
8 | - [AdminLTE skin](#adminlte-skin)
9 | - [Custom Ckeditor config path]($custom-ckeditor-config)
10 | - [Middleware](#middleware)
11 |
12 | This **Core Module** has one main configuration item, you'll find it at `config/asgard/core/core.php`.
13 |
14 | ## Admin Prefix
15 |
16 | With this configuration you can set how you access the admin dashboard. By default it is set to `backend`. Meaning you can access your admin dashboard on the following url `localhost:8000/backend` (if you're using the `artisan serve` command).
17 |
18 | ``` .language-php
19 | 'admin-prefix' => 'backend'
20 | ```
21 |
22 | ## Themes Path
23 |
24 | This is the location of the Themes.
25 |
26 | ``` .language-php
27 | 'themes_path' => base_path() . '/Themes',
28 | ```
29 |
30 | ## Admin theme
31 |
32 | With this setting you can change the theme used in the administration. Make sure your admin theme has the **type** set to `backend`.
33 |
34 | It defaults to `AdminLTE`.
35 |
36 |
37 | ``` .language-php
38 | 'admin-theme' => 'AdminLTE',
39 | ```
40 |
41 |
42 | ## AdminLTE skin
43 |
44 | You can customize the AdminLTE colors with this setting. The following colors are available for you to use:
45 |
46 | - skin-blue,
47 | - skin-green,
48 | - skin-black,
49 | - skin-purple,
50 | - skin-red,
51 | - skin-yellow.
52 |
53 | This defaults to the blue skin.
54 |
55 | ``` .language-php
56 | 'skin' => 'skin-blue',
57 | ```
58 |
59 |
60 | ## Custom Ckeditor Config path
61 |
62 | In case you wish to customise ckeditor and the default configuration provided doesn't suit you, you can define a custom ckeditor configuration file here. The paths needs to be relative to the `public/` directory.
63 |
64 | Example:
65 |
66 | ``` .language-php
67 | 'ckeditor-config-file-path' => '/assets/config_custom.js',
68 | ```
69 |
70 |
71 | ## Middleware
72 |
73 | Here you can add or remove middleware of different types of routes (admin, frontend and api). Add your own middleware here on their respective types.
--------------------------------------------------------------------------------
/v1/workshop-module/module-scaffold.md:
--------------------------------------------------------------------------------
1 | title: Create a module
2 | subtitle: Workshop Module
3 | -------
4 |
5 | - [Introduction](#introduction)
6 | - [Usage](#usage)
7 | - [Composer usage](#composer)
8 |
9 |
10 | ### Introduction
11 |
12 | The module scaffolder is a command line tool that will give you the ability to generate modules in a matter of seconds.
13 |
14 | To have a quick idea on what it does you can check out [this quickcast](http://quick.as/loki7l0).
15 |
16 | ### Usage
17 |
18 | The usage is pretty simple and straightforward. Simply call the following command from the project root:
19 |
20 | ``` .language-bash
21 | php artisan asgard:module:scaffold
22 | ```
23 |
24 | You will be asked the following questions:
25 |
26 |
27 | - What is the module name ?
28 |
29 | This is in the following format `vendor/name` all lowercase. *Do not use dashes in the module name*
30 | - Do you wish to use Doctrine or Eloquent ?
31 |
32 | This is to know what kind of Entities to generate.
33 |
34 | - Enter your desired entities
35 |
36 | You can enter as many as you like, when you're done leave empty and the next question will come up.
37 |
38 | - Enter you desired value objects
39 |
40 | Again, you can enter as many as you like, when you're done leave empty.
41 |
42 |
43 | When these questions are answered your module will be generated. You will still need to add the properties to the eloquent migration and/or to the entity (if using Doctrine).
44 |
45 | Before seeing the newly created module on the admin dashboard you will have to give you access to the new module. Go the the **User > Roles** view and edit the Admin role to give you permission to the new module.
46 |
47 | The last step required is to add you module in the `Modules/.gitignore` file as following:
48 |
49 |
50 | ``` .language-php
51 | !YourModuleName
52 | ```
53 |
54 | This will tell git to ignore everything in the Modules folder except for your modules.
55 |
56 | ### Composer usage
57 | If you want to use composer on your new module, you will need to change one simple thing, adding a custom repository :
58 |
59 | In your Modules/YourSuperModule/composer.json add
60 |
61 | ``` .language-json
62 | "repositories": [
63 | {
64 | "type": "vcs",
65 | "url": "https://github.com/nWidart/modules"
66 | }
67 | ],
68 | ```
69 |
70 | Note : this is temporary, but it's required until this dependency has been released.
71 |
--------------------------------------------------------------------------------
/v2/user-module/middleware.md:
--------------------------------------------------------------------------------
1 | title: Middleware
2 | subtitle: User Module
3 | -------
4 |
5 | - [Guest middleware](#guest_middleware)
6 | - [Logged in middleware](#logged_in_middleware)
7 | - [AuthorisedApiToken](#authorised-api-token)
8 | - [AuthorisedApiTokenAdmin](#authorised-api-token-admin)
9 |
10 | ## Guest middleware
11 |
12 | The guest middleware makes sure the current route can't be accessed by a logged in user.
13 |
14 | By setting a route in the `redirect_route_after_login` config key in the `config/asgard.user.users.php` file, you can make the middleware redirect to your desired route. This defaults to `homepage`.
15 |
16 | Example usage:
17 |
18 | ``` .language-php
19 | $router->get('login', [
20 | 'middleware' => 'auth.guest',
21 | 'as' => 'login',
22 | 'uses' => 'AuthController@getLogin',
23 | ]);
24 | ```
25 |
26 | ## Logged in middleware
27 |
28 | The logged in middleware makes sure the current route can **only** be accessed by logged in users. This will redirect the user to the login page if it fails.
29 |
30 | Example usage:
31 |
32 | ``` .language-php
33 | $router->group(['middleware' => 'logged.in'], function (Router $router) {
34 | $router->get('account', [
35 | 'as' => 'user.account',
36 | 'uses' => 'Frontend\ProfileController@show',
37 | ]);
38 | });
39 | ```
40 |
41 |
42 | ## AuthorisedApiToken
43 |
44 | This middleware allows you to protect your API routes with a user API key system.
45 |
46 | When protected your api routes with this middleware, and failing to provide an API key during the request, a `403 forbidden` response will be sent.
47 |
48 | ``` .language-php
49 | $router->group(['prefix' => 'v1', 'middleware' => 'api.token'], function (Router $router) {
50 | // Routes proteted by the middleware
51 | });
52 | ```
53 |
54 | ## AuthorisedApiTokenAdmin
55 |
56 | This is similar to the `AuthorisedApiToken` middleware, with one addition that it checks if the given API token belongs to an administrator. This can be usuful if you have api routes that must only be accessed by an administrator.
57 |
58 | Since AsgardCMS 2.0, all default API routes from the backend are protected by this middleware.
59 |
60 | ``` .language-php
61 | $router->group(['prefix' => 'v1', 'middleware' => 'api.token.admin'], function (Router $router) {
62 | // Routes proteted by the middleware
63 | });
64 | ```
--------------------------------------------------------------------------------
/v3/user-module/middleware.md:
--------------------------------------------------------------------------------
1 | title: Middleware
2 | subtitle: User Module
3 | -------
4 |
5 | - [Guest middleware](#guest_middleware)
6 | - [Logged in middleware](#logged_in_middleware)
7 | - [AuthorisedApiToken](#authorised-api-token)
8 | - [AuthorisedApiTokenAdmin](#authorised-api-token-admin)
9 |
10 | ## Guest middleware
11 |
12 | The guest middleware makes sure the current route can't be accessed by a logged in user.
13 |
14 | By setting a route in the `redirect_route_after_login` config key in the `config/asgard.user.users.php` file, you can make the middleware redirect to your desired route. This defaults to `homepage`.
15 |
16 | Example usage:
17 |
18 | ``` .language-php
19 | $router->get('login', [
20 | 'middleware' => 'auth.guest',
21 | 'as' => 'login',
22 | 'uses' => 'AuthController@getLogin',
23 | ]);
24 | ```
25 |
26 | ## Logged in middleware
27 |
28 | The logged in middleware makes sure the current route can **only** be accessed by logged in users. This will redirect the user to the login page if it fails.
29 |
30 | Example usage:
31 |
32 | ``` .language-php
33 | $router->group(['middleware' => 'logged.in'], function (Router $router) {
34 | $router->get('account', [
35 | 'as' => 'user.account',
36 | 'uses' => 'Frontend\ProfileController@show',
37 | ]);
38 | });
39 | ```
40 |
41 |
42 | ## AuthorisedApiToken
43 |
44 | This middleware allows you to protect your API routes with a user API key system.
45 |
46 | When protected your api routes with this middleware, and failing to provide an API key during the request, a `403 forbidden` response will be sent.
47 |
48 | ``` .language-php
49 | $router->group(['prefix' => 'v1', 'middleware' => 'api.token'], function (Router $router) {
50 | // Routes proteted by the middleware
51 | });
52 | ```
53 |
54 | ## AuthorisedApiTokenAdmin
55 |
56 | This is similar to the `AuthorisedApiToken` middleware, with one addition that it checks if the given API token belongs to an administrator. This can be usuful if you have api routes that must only be accessed by an administrator.
57 |
58 | Since AsgardCMS 2.0, all default API routes from the backend are protected by this middleware.
59 |
60 | ``` .language-php
61 | $router->group(['prefix' => 'v1', 'middleware' => 'api.token.admin'], function (Router $router) {
62 | // Routes proteted by the middleware
63 | });
64 | ```
--------------------------------------------------------------------------------
/v4/user-module/middleware.md:
--------------------------------------------------------------------------------
1 | title: Middleware
2 | subtitle: User Module
3 | -------
4 |
5 | - [Guest middleware](#guest_middleware)
6 | - [Logged in middleware](#logged_in_middleware)
7 | - [AuthorisedApiToken](#authorised-api-token)
8 | - [AuthorisedApiTokenAdmin](#authorised-api-token-admin)
9 |
10 | ## Guest middleware
11 |
12 | The guest middleware makes sure the current route can't be accessed by a logged in user.
13 |
14 | By setting a route in the `redirect_route_after_login` config key in the `config/asgard.user.users.php` file, you can make the middleware redirect to your desired route. This defaults to `homepage`.
15 |
16 | Example usage:
17 |
18 | ``` .language-php
19 | $router->get('login', [
20 | 'middleware' => 'auth.guest',
21 | 'as' => 'login',
22 | 'uses' => 'AuthController@getLogin',
23 | ]);
24 | ```
25 |
26 | ## Logged in middleware
27 |
28 | The logged in middleware makes sure the current route can **only** be accessed by logged in users. This will redirect the user to the login page if it fails.
29 |
30 | Example usage:
31 |
32 | ``` .language-php
33 | $router->group(['middleware' => 'logged.in'], function (Router $router) {
34 | $router->get('account', [
35 | 'as' => 'user.account',
36 | 'uses' => 'Frontend\ProfileController@show',
37 | ]);
38 | });
39 | ```
40 |
41 |
42 | ## AuthorisedApiToken
43 |
44 | This middleware allows you to protect your API routes with a user API key system.
45 |
46 | When protected your api routes with this middleware, and failing to provide an API key during the request, a `403 forbidden` response will be sent.
47 |
48 | ``` .language-php
49 | $router->group(['prefix' => 'v1', 'middleware' => 'api.token'], function (Router $router) {
50 | // Routes proteted by the middleware
51 | });
52 | ```
53 |
54 | ## AuthorisedApiTokenAdmin
55 |
56 | This is similar to the `AuthorisedApiToken` middleware, with one addition that it checks if the given API token belongs to an administrator. This can be usuful if you have api routes that must only be accessed by an administrator.
57 |
58 | Since AsgardCMS 2.0, all default API routes from the backend are protected by this middleware.
59 |
60 | ``` .language-php
61 | $router->group(['prefix' => 'v1', 'middleware' => 'api.token.admin'], function (Router $router) {
62 | // Routes proteted by the middleware
63 | });
64 | ```
--------------------------------------------------------------------------------