You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Documentation.md
+51-17Lines changed: 51 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,23 +5,27 @@ Docs will be restructured when things get implemented.
5
5
6
6
<!-- TOC -->
7
7
*[Introduction](#introduction)
8
-
*[System requirements](#system-requirements)
8
+
*[💻 System requirements](#-system-requirements)
9
9
*[Server](#server)
10
10
*[Development](#development)
11
-
*[Getting started](#getting-started)
12
-
*[Plugin development](#plugin-development)
13
-
*[Setting up](#setting-up)
14
-
*[Running tests](#running-tests)
15
-
*[Debugging](#debugging)
11
+
*[🛟 Getting started](#-getting-started)
12
+
*[🔌 Plugin development](#-plugin-development)
13
+
*[⚙️ Setting up](#-setting-up)
14
+
*[▶️ Running tests](#-running-tests)
15
+
*[Console](#console)
16
+
*[PhpStorm](#phpstorm)
17
+
*[Testing with multiple PHP versions](#testing-with-multiple-php-versions)
18
+
*[🪲 Debugging](#-debugging)
19
+
*[Xdebug in PhpStorm](#xdebug-in-phpstorm)
16
20
*[Laravel Telescope](#laravel-telescope)
17
-
*[Core concepts](#core-concepts)
18
-
*[Users](#users)
21
+
*[📑 Core concepts](#-core-concepts)
22
+
*[🙋♂️ Users](#-users)
19
23
*[Authorization](#authorization)
20
24
<!-- TOC -->
21
25
22
26
# Introduction
23
27
24
-
## System requirements
28
+
## 💻 System requirements
25
29
26
30
### Server
27
31
* PHP >= 8.3
@@ -42,7 +46,7 @@ However, if you want to create a new project via composer (recommended), you nee
42
46
All other system requirements are automatically included by the Lando instance.
43
47
Node.js and npm are provided in the lando container.
44
48
45
-
## Getting started
49
+
## 🛟 Getting started
46
50
1. Create a new project with composer:
47
51
```shell
48
52
composer create-project eclipsephp/app myprojectname -s dev
@@ -60,14 +64,14 @@ That's it! Open the provided link and the public page should be shown. Add `/adm
60
64
61
65
By doing these few steps you now have a functional Filament app with our Eclipse core package.
62
66
63
-
# Plugin development
67
+
# 🔌 Plugin development
64
68
Unfortunately, plugin development is not yet fully self-contained, meaning you need the app skeleton, where you will add the plugin you want to develop as a dependency that is symlinked from a local folder.
65
69
However, this is needed only if you want to manually test the plugin in the app (in your browser), since running the tests uses a default Testbench Laravel skeleton.
66
70
67
71
🔶 **Please note**: the core package is in fact not a Filament plugin, but nevertheless everything for plugin development also applies for core development.
68
72
69
-
## Setting up
70
-
1. Follow the above [Getting started](Documentation.md#getting-started) section to set up an app skeleton.
73
+
## ⚙️ Setting up
74
+
1. Follow the above [Getting started](Documentation.md#-getting-started) section to set up an app skeleton.
71
75
2. Then, `git clone` the plugin you want to work on to a local folder inside the app, e.g. `packages/my-package`.
72
76
3. Add the local folder as a repository in the app's `composer.json`, e.g.:
73
77
```
@@ -80,7 +84,9 @@ However, this is needed only if you want to manually test the plugin in the app
80
84
```
81
85
4. Run `composer update` to create the symlink.
82
86
83
-
## Running tests
87
+
## ▶️ Running tests
88
+
89
+
### Console
84
90
You can run the tests inside the package with
85
91
```shell
86
92
lando test
@@ -97,19 +103,47 @@ This is just a proxy to the testbench `package:test` command.
97
103
```
98
104
The reason for this is that these config files include other vendor configs that are already pre-configured the way we want them to be (i.e. multi-tenancy). All other plugins do not have this requirement — they must be built to fit any configuration.
99
105
100
-
## Debugging
106
+
💡 If you ever get an error stating your app encryption key is not set, it means the Testbench skeleton is not set up. Run `composer setup` and everything needed will be set up.
107
+
108
+
### PhpStorm
109
+
See our [Testing with PhpStorm](https://github.com/DataLinx/php-package-template/blob/main/docs/Testing%20with%20PhpStorm.md) guide to set up testing in PhpStorm.
110
+
111
+
⚠️ Please note: if you run tests in PhpStorm, the Pest cache in the `vendor/pestphp/pest/.temp` dir is created with your root user forsome reason. It's not a problem, until you want to run testsin the console. If you want to switch to testing in the console, you have to delete the created directories inside the `.temp` dir.
112
+
If you know how to fix this, please open a discussion or better yet, submit a pull request.
113
+
114
+
### Testing with multiple PHP versions
115
+
See our [Running tests for a specific PHP version with Lando](https://github.com/DataLinx/php-package-template/blob/main/docs/Running%20tests%20for%20a%20specific%20PHP%20version.md#running-tests-for-a-specific-php-version-with-lando) guide.
116
+
117
+
Apart from that, make sure that your alternative `composer.json`:
118
+
* has a `name` attribute
119
+
* includes the package service provider in`extra.laravel`
120
+
* includes the same `autoload` and `autoload-dev` lines
121
+
122
+
... since these cannot be merged from the main `composer.json`.
123
+
124
+
Also, when testing inside the alternative Lando env, forsome reason, you must use the long form `composer run-script test` instead of just `composer test`, likein the project root.
125
+
126
+
## 🪲 Debugging
127
+
128
+
### Xdebug in PhpStorm
129
+
If you follow the guide above on how to set up testing in PhpStorm, you are all set to debug while running tests. Just set breakpoints in code and run the test.
130
+
131
+
<!--
132
+
### Xdebug through the browser
133
+
TODO
134
+
-->
101
135
102
136
### Laravel Telescope
103
137
Telescope is already installed with the core package and ready to use in the development environment.
104
138
To enable it, just set the `TELESCOPE_ENABLED` variable in your `.env` file to `true` and visit the `/telescope` URL or click the _Tools > Telescope_ link in the panel navigation.
105
139
106
140
To use the dark theme also set the `TELESCOPE_DARK_THEME`.
107
141
108
-
# Core concepts
142
+
#📑 Core concepts
109
143
110
144
The following section explains the core concepts and applies to both app and plugin development.
111
145
112
-
## Users
146
+
## 🙋♂️ Users
113
147
114
148
### Authorization
115
149
For user authorization purposes, we use the [spatie/laravel-permission](https://spatie.be/docs/laravel-permission/v6) package and the [Filament Shield plugin](https://filamentphp.com/plugins/bezhansalleh-shield).
0 commit comments