Skip to content

Commit

Permalink
docs: write docs
Browse files Browse the repository at this point in the history
  • Loading branch information
regnerisch committed May 26, 2024
1 parent 41b5ca6 commit 9246a4e
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 41 deletions.
27 changes: 0 additions & 27 deletions .release-it.json

This file was deleted.

14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@ In version 7 we changed the way how Laravel Beyond works. We now do no longer ch
directory structure, instead we place the DDD structure inside a separate `src` directory. This ensures
compatibility with any other (Laravel related) package.

## Upgrade Guide
Please read our [Upgrade Guide](UPGRADE.md) in case you are using an older version or `regnerisch/laravel-beyond`.

## Installation

Install laravel-beyond with composer:
```bash
composer require --dev akrillia/laravel-beyond
```

Register the namespaces inside your `composer.json`:
Add Laravel Beyonds namespaces inside your `composer.json`:
```json
{
// ...
Expand All @@ -37,7 +34,9 @@ Register the namespaces inside your `composer.json`:
// ...
}
```
Run `composer dump-autoload` and everything is set up for using Laravel Beyond commands.

> [!WARNING]
> Do not forget to run `composer dump-autoload` after adding the namespaces.
## Documentation
Take a look at our documentation inside [`/docs`](docs/README.md) to learn about the available
Expand All @@ -56,7 +55,6 @@ commands and how to use them.
| | | |- Queries
| | | |- Requests
| | | |- Resources
| | | |- Rules
| |- Domain
| | |- User
| | | |- Actions
Expand All @@ -68,6 +66,10 @@ commands and how to use them.
| | | |- Listeners
| | | |- Models
| | | |- Observers
| | Support
| | | |- Casts
| | | |- Providers
| | | |- Rules
```

## Contributors
Expand Down
49 changes: 49 additions & 0 deletions bin/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env bash

set -e

# Make sure the release tag is provided.
if (( "$#" != 1 ))
then
echo "Tag has to be provided."

exit 1
fi

RELEASE_BRANCH="7.x"
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
VERSION=$1

# Make sure current branch and release branch match.
if [[ "$RELEASE_BRANCH" != "$CURRENT_BRANCH" ]]
then
echo "Release branch ($RELEASE_BRANCH) does not match the current active branch ($CURRENT_BRANCH)."
exit 1
fi

# Make sure the working directory is clear.
if [[ -n "$(git status --porcelain)" ]]
then
echo "Your working directory is dirty. Did you forget to commit your changes?"
exit 1
fi

# Make sure latest changes are fetched first.
git fetch origin

# Make sure that release branch is in sync with origin.
if [[ $(git rev-parse HEAD) != $(git rev-parse origin/$RELEASE_BRANCH) ]]
then
echo "Your branch is out of date with its upstream. Did you forget to pull or push any changes before releasing?"
exit 1
fi

# Always prepend with "v"
if [[ $VERSION != v* ]]
then
VERSION="v$VERSION"
fi

# Tag Package
git tag "$VERSION"
git push origin --tags
23 changes: 23 additions & 0 deletions bin/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

PHP_VERSION="8.2"

if ! docker info > /dev/null 2>&1; then
echo "Please start docker first"
exit 0
fi

echo "Running pint..."
if ! docker run -it --rm -v "$PWD":/app -w /app php:"$PHP_VERSION"-cli php vendor/bin/pint; then
exit 1
fi

echo "Running phpstan..."
if ! docker run -it --rm -v "$PWD":/app -w /app php:"$PHP_VERSION"-cli php vendor/bin/phpstan analyse; then
exit 1
fi

echo "Running phpunit..."
if ! docker run -it --rm -v "$PWD":/app -w /app php:"$PHP_VERSION"-cli php vendor/bin/phpunit; then
exit 1
fi
8 changes: 1 addition & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "akrillia/laravel-beyond",
"type": "library",
"license": "ISC",
"version": "7.0.0-beta.8",
"version": "7.0.0",
"autoload": {
"psr-4": {
"AkrilliA\\LaravelBeyond\\": "src/"
Expand Down Expand Up @@ -50,12 +50,6 @@
"spatie/laravel-queueable-action": "^2.14",
"phpstan/phpstan": "^1.10|^2.0"
},
"suggest": {
"spatie/laravel-query-builder": "This package is required for Queries.",
"spatie/laravel-data": "This package is required for DataTransferObjects.",
"spatie/laravel-queueable-action": "This package is required for queueable actions.",
"qossmic/deptrac-shim": "This package can help you enforce architectural decisions by Laraval Beyond."
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- [`beyond:make:enum`](commands/make-enum.md)
- `beyond:make:event`
- `beyond:make:listener`
- `beyond:make:model`
- [`beyond:make:model`](commands/make-model.md)
- `beyond:make:observer`
- [`beyond:make:scope`](commands/make-scope.md)

Expand Down
13 changes: 13 additions & 0 deletions docs/commands/make-model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# `beyond:make:model`
Creates a new model.

## Signature
`beyond:make:model {name} {--force}`

| Parameters | Description |
|------------|------------------------|
| name | The name of your model |

| Flags | Description |
|---------|-------------------------|
| --force | Overwrite existing file |

0 comments on commit 9246a4e

Please sign in to comment.