Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
cd04fa8
Merge pull request #77 from phenixphp/release/0.4.1
barbosa89 Dec 24, 2024
3fe4b68
feat: integrate sessions
obarbosa89 Jan 3, 2025
12c0f82
style: phpcs
obarbosa89 Jan 3, 2025
92c435a
ci: add check coding format step
obarbosa89 Jan 3, 2025
420ed9b
style: phpcs
obarbosa89 Jan 3, 2025
7a0ff84
Merge pull request #78 from phenixphp/feature/integrate-sessions
barbosa89 Jan 3, 2025
f92e893
feat: initial config for docker
FSHLL Mar 3, 2025
ec57e25
fix: improve server start output format
obarbosa89 Aug 6, 2025
7b00029
chore: update .env.example with QUEUE_DRIVER and CORS_ORIGIN variables
obarbosa89 Aug 6, 2025
1e406b6
Implement code changes to enhance functionality and improve performance
obarbosa89 Aug 6, 2025
82d4288
feature: update config file
obarbosa89 Aug 6, 2025
b04777a
fix: update database driver configuration to use string literals
obarbosa89 Aug 18, 2025
faf1b64
fix: add missing queue driver configuration options for parallel proc…
obarbosa89 Aug 18, 2025
bffd303
chore: update .env.example with Redis configuration options
obarbosa89 Aug 20, 2025
d6d00cc
refactor: update closure syntax to include return types in configurat…
obarbosa89 Aug 20, 2025
9a3715b
chore: remove redundant REDIS_USERNAME entry from .env.example
obarbosa89 Aug 20, 2025
afc7a9c
docs: add AI coding instructions for Phenix framework
obarbosa89 Aug 22, 2025
a8e5134
docs: enhance development instructions for improved performance
obarbosa89 Aug 22, 2025
2dc8128
chore: remove nunomaduro/phpinsights and update analyze script to use…
obarbosa89 Aug 22, 2025
2582201
chore: update guzzlehttp/promises and guzzlehttp/psr7 to latest versions
obarbosa89 Aug 22, 2025
5291374
chore: update framework
obarbosa89 Aug 22, 2025
42096c1
chore: install framework v6
obarbosa89 Aug 22, 2025
ab8d729
fix: correct namespace import for HttpMethod in Pest.php
obarbosa89 Aug 22, 2025
239b52e
Merge pull request #80 from phenixphp/feature/task-integration
barbosa89 Aug 22, 2025
e2b07b9
feat: enhance server process management with error handling and healt…
obarbosa89 Aug 23, 2025
da0b468
feat: implement periodic health check for server process management
obarbosa89 Aug 23, 2025
3d0b6d4
fix: improve server termination process and error handling
obarbosa89 Aug 23, 2025
aa45281
feat: enhance server error handling with stop attempts and health che…
obarbosa89 Aug 23, 2025
96bd1aa
feat: enhance output formatting with colorized messages for server st…
obarbosa89 Aug 23, 2025
0538f1d
feat: refactor line colorization logic for improved readability and m…
obarbosa89 Aug 23, 2025
cf93ed8
Merge pull request #81 from phenixphp/feature/dev-server-improvements
barbosa89 Aug 23, 2025
4b473f8
Merge branch 'develop' into feature/docker-config
FSHLL Aug 25, 2025
592eda4
fix: use node lts in dockerfile image
FSHLL Aug 25, 2025
38c4bf6
feat: default environment app name in .env.example
FSHLL Aug 25, 2025
67f77bc
fix: use default process class for execute server and get correct PDI
FSHLL Aug 25, 2025
a03e454
Merge branch 'phenixphp:main' into feature/docker-config
FSHLL Aug 25, 2025
cb6c04a
Merge branch 'develop' into feature/docker-config
FSHLL Aug 25, 2025
338e6b2
Merge pull request #79 from FSHLL/feature/docker-config
barbosa89 Aug 25, 2025
a9189dc
refactor: update Docker configuration and environment variables for c…
obarbosa89 Aug 25, 2025
a3f2fb1
refactor: reorganize Dockerfile stages and improve package installation
obarbosa89 Aug 25, 2025
4679ca1
refactor: update docker-compose configuration for app and mysql services
obarbosa89 Aug 25, 2025
32ac678
refactor: update entrypoint script to use bash and improve environmen…
obarbosa89 Aug 25, 2025
346f510
refactor: change environment target from development to local in Dock…
obarbosa89 Aug 25, 2025
6434677
refactor: add .dockerignore file to exclude unnecessary files from Do…
obarbosa89 Aug 25, 2025
856b343
refactor: simplify entrypoint script by removing MySQL readiness chec…
obarbosa89 Aug 25, 2025
d7baef3
refactor: remove unnecessary executable permission change for phenix …
obarbosa89 Aug 25, 2025
f5379fe
refactor: set default values for MySQL environment variables in docke…
obarbosa89 Aug 25, 2025
1b39555
refactor: update MySQL username in environment configuration to 'root'
obarbosa89 Aug 25, 2025
c833f59
refactor: remove .env from .dockerignore to allow environment variabl…
obarbosa89 Aug 26, 2025
1abd4ef
refactor: improve database configuration
obarbosa89 Aug 26, 2025
c7d386d
refactor: add .env to .dockerignore to prevent environment variable e…
obarbosa89 Aug 26, 2025
003e0f6
refactor: use static function syntax for environment variable default…
obarbosa89 Aug 26, 2025
39fc149
refactor: update docker-compose and Dockerfile for improved structure…
obarbosa89 Aug 26, 2025
502bb65
refactor: update database and Redis configuration in .env.example for…
obarbosa89 Aug 26, 2025
f4af1f8
feat: add .env.example.docker for Docker environment configuration
obarbosa89 Aug 26, 2025
69a2c2f
refactor: ensure proper newline at end of files in configuration and …
obarbosa89 Aug 27, 2025
08714c7
refactor: change QUEUE_DRIVER from parallel to database in .env.examp…
obarbosa89 Aug 27, 2025
396ba2f
Merge pull request #82 from phenixphp/feature/docker-improvements
barbosa89 Aug 27, 2025
3693f85
feat: add process ID output when server starts
obarbosa89 Aug 6, 2025
86db315
fix: update phenixphp/framework requirement to dev-feature/users-module
obarbosa89 Aug 6, 2025
c31266a
feat: implement user management with CRUD operations and user table m…
obarbosa89 Aug 6, 2025
8b51753
Implement code changes to enhance functionality and improve performance
obarbosa89 Aug 6, 2025
8c6f9b5
fix: update phenixphp/framework requirement to dev-feature/users-module
obarbosa89 Aug 6, 2025
0331ccf
fix: revert phenixphp/framework requirement to stable version
obarbosa89 Aug 23, 2025
09c9519
chore: update dependencies
obarbosa89 Aug 23, 2025
0976b4b
chore: restore code
obarbosa89 Aug 27, 2025
2140e89
refactor: remove non required classes and code
obarbosa89 Aug 27, 2025
423cfc0
feat: install dev branch of framework
obarbosa89 Oct 7, 2025
33150e2
feat: register available app configs
obarbosa89 Oct 7, 2025
a5c4734
feat: add translations for validation
obarbosa89 Oct 7, 2025
ca064b1
feat: registration feature
obarbosa89 Oct 7, 2025
32615ba
feat: add user registration test
obarbosa89 Oct 24, 2025
6aa75c1
feat: implement email verification for user registration
obarbosa89 Oct 27, 2025
cb77569
feat: add mail configuration to .env.example
obarbosa89 Oct 27, 2025
1e3f5d0
feat: add RefreshDatabase trait to RegisterTest for improved test iso…
obarbosa89 Oct 27, 2025
b16f4fc
refactor: improve readability of getEnvFile method in TestCase
obarbosa89 Oct 27, 2025
5f087eb
refactor: remove unused InteractWithDatabase trait from RegisterTest
obarbosa89 Nov 5, 2025
4c50b45
refactor: update test case binding to use AsyncTestCase for unit tests
obarbosa89 Nov 5, 2025
29c2224
feat: enhance email validation in RegisterController with DNS and RFC…
obarbosa89 Nov 7, 2025
1f5a66b
refactor: update user table migration to use fluent column definition…
obarbosa89 Nov 7, 2025
1498ae3
feat: implement OneTimePasswordScope enum and UserOtp model with migr…
obarbosa89 Nov 7, 2025
5ea3721
refactor: enhance user_one_time_passwords migration with primary key …
obarbosa89 Nov 7, 2025
966e083
refactor: update user creation logic in RegisterController to use exp…
obarbosa89 Nov 7, 2025
ff61651
feat: implement One-Time Password (OTP) functionality with email veri…
obarbosa89 Nov 7, 2025
f342fc4
refactor: update email verification mail class in RegisterTest to use…
obarbosa89 Nov 7, 2025
cf127d6
style: php cs
obarbosa89 Nov 7, 2025
287d1ab
refactor: update config files
obarbosa89 Jan 5, 2026
e2cf1ad
chore: add *.sqlite* to .gitignore
obarbosa89 Jan 5, 2026
ba5011b
chore: remove empty .keep file from tests/Feature directory
obarbosa89 Jan 5, 2026
d9ae14e
chore: add SYS_PTRACE capability and seccomp security option to app s…
obarbosa89 Feb 10, 2026
1371e2a
feat: remove pest
obarbosa89 Feb 10, 2026
a86f14a
feat: register user
obarbosa89 Feb 10, 2026
81fe598
refactor: rewrite test in PHPUnit
obarbosa89 Feb 10, 2026
e255309
style: php cs
obarbosa89 Feb 10, 2026
8538bb3
feat: add pcntl and sockets extensions to Dockerfile
obarbosa89 Feb 10, 2026
e8f3eae
feat: update UserOtp creation method and enhance email verification test
obarbosa89 Feb 12, 2026
fc6d967
feat: update framework version to dev-feature/integration-v080 in com…
obarbosa89 Feb 12, 2026
1de439c
feat: email verification using otp
obarbosa89 Mar 2, 2026
2b27fe5
feat: use faker for dynamic email generation in VerifyEmailTest
obarbosa89 Mar 2, 2026
35111bd
feat: sync config files with framework
obarbosa89 Mar 11, 2026
6841c75
feat: add scheduled task to delete unused UserOtp records
obarbosa89 Mar 11, 2026
f0aba6f
feat: implement ResendOtpController and corresponding tests for email…
obarbosa89 Mar 13, 2026
e958748
tests(refactor): remove non required tests
obarbosa89 Mar 14, 2026
f450548
tests(refactor): remove data key wrapper
obarbosa89 Mar 14, 2026
3e38b3e
chore: remove non required docblocks
obarbosa89 Mar 14, 2026
9b61218
feat: login and logout flows
obarbosa89 Mar 20, 2026
fb1970c
feat: implement translations
obarbosa89 Mar 20, 2026
4d559c7
feat: reponds 401 if token is present in guest routes
obarbosa89 Mar 20, 2026
da550e4
refactor: rename class
obarbosa89 Mar 20, 2026
88ab737
refactor: fix import statement for Router class
obarbosa89 Mar 20, 2026
0e07ce9
feat: implement forgot and reset password functionality with OTP
obarbosa89 Mar 24, 2026
f5eb203
refactor: remove unauthorized response tests for login and resend OTP
obarbosa89 Mar 24, 2026
8186ee7
chore: remove invalid file
obarbosa89 Mar 24, 2026
92475cf
style: php cs
obarbosa89 Mar 24, 2026
963eb6b
chore: update dependencies
obarbosa89 Mar 24, 2026
d8326d3
feat: implement token management functionality with listing, refreshi…
obarbosa89 Mar 25, 2026
68a113a
feat: add cancel registration functionality with validation and tests
obarbosa89 Mar 25, 2026
f6b5e05
style: php cs
obarbosa89 Mar 25, 2026
6db9653
tests(refactor): use route global helper
obarbosa89 Mar 25, 2026
684c72c
feat: remove Guest middleware and update related routes and tests
obarbosa89 Mar 25, 2026
9b1ad8d
chore: update phenixphp/framework version to stable release
obarbosa89 Mar 25, 2026
062634f
feat: update composer.json to include additional extensions and impro…
obarbosa89 Mar 25, 2026
3241049
style: add phpstan ignore comment for mailable resolution
obarbosa89 Mar 25, 2026
ea4cf80
chore: update phenixphp/framework version to ^0.8.2
obarbosa89 Mar 26, 2026
3d9ce7a
ci: add key generation step before executing tests
obarbosa89 Mar 26, 2026
85094ad
ci: update environment configuration for Redis and MySQL services in …
obarbosa89 Mar 26, 2026
d505ccc
ci: update database username to 'root' and adjust MySQL service confi…
obarbosa89 Mar 26, 2026
a80616c
ci: update database password and configuration for MySQL service in C…
obarbosa89 Mar 26, 2026
b9306ab
ci: update environment file handling for PHPStan and PHPUnit execution
obarbosa89 Mar 26, 2026
508bc9b
ci: update MySQL service configuration and test execution command in …
obarbosa89 Mar 26, 2026
4223aad
feat: update phenixphp/framework version to ^0.8.3 in composer.json
obarbosa89 Mar 31, 2026
7fcbd5a
feat: update phenixphp/framework version to ^0.8.4 in composer.json
obarbosa89 Apr 1, 2026
4525077
feat: change LOG_CHANNEL from stream to file in .env.example
obarbosa89 Apr 1, 2026
cd843f3
feat: update phenixphp/framework version to ^0.8.5 in composer.json
obarbosa89 Apr 1, 2026
957946e
ci: update PHPStan command and change SonarQube action in CI workflow
obarbosa89 Apr 1, 2026
62d2013
refactor: enhance OTP handling in login and reset password processes …
obarbosa89 Apr 1, 2026
5b48b9c
refacttor: rename mailables
leonardo2006jaimes-ux Apr 3, 2026
4f876fa
refacttor: rename mailables
leonardo2006jaimes-ux Apr 3, 2026
35d6418
refactor: remove docblock
leonardo2006jaimes-ux Apr 3, 2026
018925e
refactor: split routes
leonardo2006jaimes-ux Apr 3, 2026
be2c206
Merge pull request #84 from leonardo2006jaimes-ux/feature/user-authen…
barbosa89 Apr 3, 2026
901e236
Merge branch 'feature/user-authentication' of github.com:phenixphp/ph…
obarbosa89 Apr 4, 2026
5c6e7b9
style: php cs
obarbosa89 Apr 4, 2026
5d8eacf
Merge pull request #83 from phenixphp/feature/user-authentication
barbosa89 Apr 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.git
.gitignore
.gitattributes

Dockerfile
docker-compose.yml
.dockerignore

README.md
CHANGELOG.md
LICENSE.md
docs/

.vscode/
.idea/
*.swp
*.swo

.DS_Store
Thumbs.db

storage/logs/*
storage/framework/logs/*
storage/app/public/*
storage/framework/cache/*
storage/framework/sessions/*
storage/framework/testing/*
storage/framework/views/*

node_modules/
vendor/

.env

build/
coverage/

*.tmp
*.log
*.pid
*.seed
*.pid.lock

.phpunit.result.cache
.php_cs.cache

dist/
public/build/
31 changes: 29 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
APP_NAME=Phenix
APP_KEY=
APP_ENV=local
APP_DEBUG=true
APP_URL=http://127.0.0.1
APP_PORT=1337

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=phenix
DB_USERNAME=root
DB_PASSWORD=
DB_PASSWORD=secret

LOG_CHANNEL=stream
LOG_CHANNEL=file

CACHE_STORE=redis
RATE_LIMIT_STORE="${CACHE_STORE}"

QUEUE_DRIVER=redis

CORS_ORIGIN=

REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_USERNAME=
REDIS_PASSWORD=null

SESSION_DRIVER=redis

MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=587
MAIL_ENCRYPTION=tls
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS=hello@example.com
MAIL_FROM_NAME="Example"
26 changes: 26 additions & 0 deletions .env.example.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
APP_NAME=Phenix
APP_KEY=
APP_ENV=local
APP_DEBUG=true
APP_URL=http://127.0.0.1
APP_PORT=1337

DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=phenix
DB_USERNAME=phenix
DB_PASSWORD=secret
MYSQL_PORT=3307

LOG_CHANNEL=stream

QUEUE_DRIVER=database

CORS_ORIGIN=

REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=null

SESSION_DRIVER=redis
142 changes: 142 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Phenix Framework - AI Coding Instructions

## Architecture Overview

**Phenix** is an asynchronous PHP web framework built on the [AmPHP](https://amphp.org/) ecosystem. This is a **skeleton application** that depends on `phenixphp/framework` for core functionality. Official documentation can be found at [Phenix Documentation](https://phenix.omarbarbosa.com/).

### Key Components
- **App Structure**: Standard MVC with `app/` (controllers, tasks), `config/` (service configs), `routes/` (API definitions)
- **Framework Integration**: Core framework lives in `vendor/phenixphp/framework/src/` - reference this for understanding internals
- **Service Providers**: Configured in `config/app.php` - handles DI container, routing, queue, database, etc.
- **Entry Points**: `public/index.php` (HTTP server), `phenix` CLI (console commands)

## Development Workflow

### Server & Hot Reloading
```bash
composer dev # Starts development server with file watcher
# OR directly: php server # Custom file watcher that restarts on changes
XDEBUG_MODE=off php public/index.php # Direct server start (faster, no debugging)
```
- Server runs on `APP_URL:APP_PORT` (default: http://127.0.0.1:1337)
- Watches: `app/`, `config/`, `routes/`, `database/`, `composer.json`, `.env`
- Requires Node.js for chokidar file watcher
- Use `XDEBUG_MODE=off` for better performance when debugging isn't needed

### Testing
```bash
composer test # PHPUnit tests (XDEBUG_MODE=off)
composer test:coverage # With coverage reports
```
- **Test Framework**: PHPUnit with custom HTTP client helpers
- **Test Structure**: `tests/Feature/` and `tests/Unit/` with shared `TestCase`
- **HTTP Testing**: Uses Amp HTTP client with helper functions: `get()`, `post()`, etc.

### Quality Tools
```bash
composer format # PHP CS Fixer
composer analyze # PHPStan
```

## Queue System Architecture

**Critical Pattern**: This project implements an async task queue system with Redis/Database backends.

### Task Definition
```php
// Extend QueuableTask for background jobs
class MyTask extends QueuableTask
{
protected int|null $maxTries = 3; // Configure retries

protected function handle(Channel $channel, Cancellation $cancellation): Result
{
// Async task logic here
return Result::success('TaskName', 'Success message');
}
}
```

### Task Dispatch
```php
// From controllers/anywhere:
MyTask::dispatch(); // Queue immediately
MyTask::enqueue()->delay(60); // Queue with delay
MyTask::dispatchIf($condition); // Conditional dispatch
```

### Queue Workers
```bash
./phenix queue:work redis --queue=default # Process queue
./phenix queue:work --once # Process once and exit
./phenix queue:work --chunks # Batch processing
```

## Configuration Patterns

### Environment-Driven Config
```php
// config/ files use closures for lazy evaluation:
'driver' => env('QUEUE_DRIVER', static fn (): string => 'database'),
'timeout' => env('TIMEOUT', static fn (): int => 30),
```

### Service Provider Registration
- All providers registered in `config/app.php`
- Queue system: `QueueServiceProvider`, `TaskServiceProvider`
- Database: Supports MySQL/PostgreSQL with migrations via Phinx

## Data Layer

### Database
- **Migrations**: `database/migrations/` using Phinx (not Eloquent)
- **Configuration**: `config/database.php` supports multiple connections
- **CLI**: `./phenix` provides migration commands

### Queue Backends
- **Redis**: Uses Lua scripts for atomic operations (`LuaScripts.php`)
- **Database**: Uses tasks table with state management
- **Parallel**: AmPHP parallel processing with worker pools

## HTTP Layer

### Routing
```php
// routes/api.php - use Facade pattern:
Route::get('/', [WelcomeController::class, 'index']);
Route::post('/tasks', [TaskController::class, 'store']);
```

### Controllers
```php
class MyController extends Controller
{
public function index(): Response
{
return response()->json(['data' => $data]);
// OR: response()->plain('text');
}
}
```

## Key Conventions

1. **Strict Types**: Always use `declare(strict_types=1);`
2. **Static Factories**: Config uses static closures for defaults
3. **Facade Pattern**: `Phenix\Facades\*` for service access
4. **Result Objects**: Tasks return `Result::success()` or `Result::failure()`
5. **Async First**: Built for non-blocking I/O with AmPHP primitives

## Critical Files to Reference

- `config/app.php` - Service provider registration and app config
- `vendor/phenixphp/framework/src/Queue/` - Queue implementation details
- `vendor/phenixphp/framework/src/Tasks/QueuableTask.php` - Base task class
- `bootstrap/app.php` - Application bootstrap via `AppBuilder`

## Common Pitfalls

1. **Queue Retries**: Tasks need explicit `$maxTries` property set
2. **Environment**: Copy `.env.example` to `.env` for local development
3. **CLI vs HTTP**: Different entry points (`phenix` vs `public/index.php`)
4. **Dependencies**: Framework code lives in vendor - check there for implementation details
41 changes: 33 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,30 @@ on:
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: phenix
MYSQL_USER: phenix
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: secret
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -psecret --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=10
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd="redis-cli ping"
--health-interval=10s
--health-timeout=5s
--health-retries=10

steps:
- name: Checkout code
Expand All @@ -20,7 +44,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: json, mbstring, pcntl, intl, fileinfo
extensions: json, mbstring, pcntl, intl, fileinfo, sockets, mysqli, sqlite3
coverage: xdebug

- name: Setup problem matchers
Expand All @@ -32,27 +56,28 @@ jobs:
run: |
composer install --no-interaction --prefer-dist --no-progress --no-suggest

- name: Check quality code with PHPInsights
- name: Check code formatting with PHP CS Fixer
run: |
vendor/bin/phpinsights -n --ansi --format=github-action
vendor/bin/php-cs-fixer fix --dry-run --diff --ansi

- name: Analyze code statically with PHPStan
run: |
cp .env.example .env
vendor/bin/phpstan --xdebug
cp .env.example .env.testing
XDEBUG_MODE=off vendor/bin/phpstan --xdebug

- name: Execute tests
run: |
cp .env.example .env
vendor/bin/pest --coverage
cp .env.example .env.testing
php phenix key:generate .env.testing --force
vendor/bin/phpunit

- name: Prepare paths for SonarQube analysis
run: |
sed -i "s|$GITHUB_WORKSPACE|/github/workspace|g" build/logs/clover.xml
sed -i "s|$GITHUB_WORKSPACE|/github/workspace|g" build/report.junit.xml

- name: Run SonarQube analysis
uses: sonarsource/sonarcloud-github-action@master
uses: sonarsource/sonarqube-scan-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ tests/coverage
node_modules
npm-debug.log
package-lock.json
package.json
package.json
*.sqlite*
21 changes: 21 additions & 0 deletions app/Constants/OneTimePasswordScope.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

namespace App\Constants;

enum OneTimePasswordScope: string
{
case LOGIN = 'login';

case RESET_PASSWORD = 'reset_password';

case VERIFY_EMAIL = 'verify_email';

case AUTHORIZE = 'authorize';

public static function toArray(): array
{
return array_column(self::cases(), 'value');
}
}
Loading
Loading