@@ -7,13 +7,33 @@ Plugins are in beta (since Release _Isfahan_) and installation or the overall AP
77
88## Plugin structure
99
10- Before actually creating a plugin, here is how the folder structure of your plugin ** has** to be:
1110
12- - ` App ` : Hosting your Laravel Models and an ` info.xml ` file with several metadata of your plugin
13- - ` Controllers ` : Hosting your Laravel Controllers
14- - ` Migration ` : Place your migration files here
15- - ` js ` : This is the destination folder for your Vue/JavaScript code. ** Important** : Bundle ** all** your JavaScript code into a single ` script.js ` file!
16- - ` routes ` : Place for your (API) routes to connect your JS code with the Laravel Backend (` api.php ` )
11+ ```
12+ app/Plugins/YourPlugin/
13+ ├── App
14+ │ ├── Controllers/ # Controller classes
15+ │ ├── Models/ # Laravel database models
16+ │ ├── Scopes/ # Model scopes
17+ │ ├── Support/ # Support classes
18+ │ ├── Services/ # Service classes that can be autoloaded into other classed
19+ │ ├── Utils/ # Static utility functions
20+ │ └── ...
21+ ├── migrations/ # Plugin migrations
22+ │ ├── yyyy_mm_dd_hhmmss_migration_name.php # Migrations in this specific format.
23+ │ └── ...
24+ ├── routes/ # Plugin routes
25+ ├── src/ # Frontend source files
26+ ├── js/
27+ │ ├── script.js.map # Compiled map file for development
28+ │ └── script.js # Compiled plugin script - REQUIRED
29+ ├── vendor/ # Composer vendor directory generated by the plugin via composer install
30+ ├── CHANGELOG.md # Version history
31+ ├── composer.json # PHP dependencies
32+ ├── package.json # JavaScript dependencies
33+ ├── permissions.json # Plugin permissions
34+ ├── plugin.xml # Plugin metadata - REQUIRED
35+ └── role-presets.json # Role presets
36+ ```
1737
1838## Creating a Plugin
1939
@@ -113,7 +133,7 @@ mkdir -p src/components
113133mkdir src/i18n
114134```
115135
116- #### info .xml
136+ #### plugin .xml
117137
118138This File is mandatory and stores all the information about your plugin. Author, Licence, Version, Description, ...
119139
@@ -128,6 +148,21 @@ This File is mandatory and stores all the information about your plugin. Author,
128148 <authors >
129149 <author >Vinzenz Rosenkranz</author >
130150 </authors >
151+ <dependencies >
152+ <depends-on plugin =" file" min-version =" 2.0" />
153+ </dependencies >
154+ <routes >
155+ <route src =" routes/api.php" />
156+ </routes >
157+ <hooks >
158+ <hook on =" " />
159+ </hooks >
160+ <role-presets >
161+ <role-preset src =" role-resets.json" />
162+ </role-presets >
163+ <permissions >
164+ <permission src =" permission.json" />
165+ </permissions >
131166</info >
132167
133168```
0 commit comments