first commit

This commit is contained in:
Romulus21
2026-05-26 10:48:10 +02:00
commit f51ff75eec
6 changed files with 7750 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Overview
`castes/delegate-auth` is a Laravel package (PHP ^8.3, Laravel ^10|^11) installed via Composer on an existing Laravel project. Its primary purpose is to publish a configuration file (`delegate-auth.php`) into the host application's `config/` directory. Namespace: `Rodev\DelegateAuth`.
The package is still in scaffolding — several placeholder names from the generator template have not yet been replaced.
## Commands
Install dependencies:
```bash
composer install
```
Run tests (via Orchestra Testbench):
```bash
vendor/bin/phpunit
# single file:
vendor/bin/phpunit tests/Path/To/TestFile.php
```
## Architecture
- **`src/DelegateAuthServiceProvider.php`** — registers the package. Merges the default config, binds a singleton under the `delegate-auth` key, and in `boot()` publishes config/migrations, loads routes, and loads views.
- **`src/Console/InstallCommand.php`** — Artisan command (`mon-package:install`) that calls `vendor:publish` for config and migrations.
- **`config/deletgate-auth.php`** — single key `encrypt_key` sourced from `DELEGATE_KEY` env var.
## Known Issues (scaffolding not yet cleaned up)
- Config filename typo: `deletgate-auth.php` should be `delegate-auth.php`. The service provider references the correct name, so this causes a runtime error.
- The class inside `DelegateAuthServiceProvider.php` is still named `MonPackageServiceProvider`.
- The service provider references `MonPackageClass` (the main service class) which does not exist yet.
- `composer.json` `extra.laravel` still declares the placeholder provider (`MonPackageServiceProvider`) and facade (`MonPackage`).
- `InstallCommand` still references `TonNamespace\\MonPackage\\MonPackageServiceProvider`.
- `tests/` directory does not exist yet (`autoload-dev` is configured for `Rodev\DelegateAuth\Tests\`).