Skip to content

Commit 8f8afbb

Browse files
committed
docs: update docs
1 parent 2c76a47 commit 8f8afbb

1 file changed

Lines changed: 51 additions & 17 deletions

File tree

docs/Documentation.md

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,27 @@ Docs will be restructured when things get implemented.
55

66
<!-- TOC -->
77
* [Introduction](#introduction)
8-
* [System requirements](#system-requirements)
8+
* [💻 System requirements](#-system-requirements)
99
* [Server](#server)
1010
* [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)
1620
* [Laravel Telescope](#laravel-telescope)
17-
* [Core concepts](#core-concepts)
18-
* [Users](#users)
21+
* [📑 Core concepts](#-core-concepts)
22+
* [🙋‍♂️ Users](#-users)
1923
* [Authorization](#authorization)
2024
<!-- TOC -->
2125

2226
# Introduction
2327

24-
## System requirements
28+
## 💻 System requirements
2529

2630
### Server
2731
* PHP >= 8.3
@@ -42,7 +46,7 @@ However, if you want to create a new project via composer (recommended), you nee
4246
All other system requirements are automatically included by the Lando instance.
4347
Node.js and npm are provided in the lando container.
4448

45-
## Getting started
49+
## 🛟 Getting started
4650
1. Create a new project with composer:
4751
```shell
4852
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
6064
6165
By doing these few steps you now have a functional Filament app with our Eclipse core package.
6266
63-
# Plugin development
67+
# 🔌 Plugin development
6468
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.
6569
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.
6670
6771
🔶 **Please note**: the core package is in fact not a Filament plugin, but nevertheless everything for plugin development also applies for core development.
6872
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.
7175
2. Then, `git clone` the plugin you want to work on to a local folder inside the app, e.g. `packages/my-package`.
7276
3. Add the local folder as a repository in the app's `composer.json`, e.g.:
7377
```
@@ -80,7 +84,9 @@ However, this is needed only if you want to manually test the plugin in the app
8084
```
8185
4. Run `composer update` to create the symlink.
8286

83-
## Running tests
87+
## ▶️ Running tests
88+
89+
### Console
8490
You can run the tests inside the package with
8591
```shell
8692
lando test
@@ -97,19 +103,47 @@ This is just a proxy to the testbench `package:test` command.
97103
```
98104
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.
99105

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 for some reason. It's not a problem, until you want to run tests in 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, for some reason, you must use the long form `composer run-script test` instead of just `composer test`, like in 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+
-->
101135

102136
### Laravel Telescope
103137
Telescope is already installed with the core package and ready to use in the development environment.
104138
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.
105139

106140
To use the dark theme also set the `TELESCOPE_DARK_THEME`.
107141

108-
# Core concepts
142+
# 📑 Core concepts
109143

110144
The following section explains the core concepts and applies to both app and plugin development.
111145

112-
## Users
146+
## 🙋‍♂️ Users
113147

114148
### Authorization
115149
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

Comments
 (0)