From 38d9063231a6317a1f770c6faf89381f8573f53d Mon Sep 17 00:00:00 2001 From: Victor Ukam Date: Fri, 27 Mar 2026 08:40:54 +0000 Subject: [PATCH 1/6] Add support for Laravel 13 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index bea4abd..313c7ca 100644 --- a/composer.json +++ b/composer.json @@ -26,9 +26,9 @@ "php": "^8.2", "sebastian/diff": "^7.0.0", "nesbot/carbon": "^3.0", - "illuminate/container": "^11.0|^12.0", - "illuminate/database": "^11.0|^12.0", - "illuminate/support": "^11.0|^12.0" + "illuminate/container": "^11.0|^12.0|^13.0", + "illuminate/database": "^11.0|^12.0|^13.0", + "illuminate/support": "^11.0|^12.0|^13.0" }, "require-dev": { "mockery/mockery": "^1.0", From fc92a6521eced247f0e57e07ac4bab90a906f853 Mon Sep 17 00:00:00 2001 From: Victor Ukam Date: Fri, 27 Mar 2026 15:03:26 +0000 Subject: [PATCH 2/6] Refactor keywords in composer.json to improve clarity and relevance --- composer.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 313c7ca..60b562d 100644 --- a/composer.json +++ b/composer.json @@ -11,16 +11,20 @@ } ], "keywords": [ - "veeqtoh", - "victor-ukam", + "ai", + "laravel", + "laravel-package", + "laravel-ai", + "laravel-ai-sdk", + "agentic-prompting", + "agentic-ai", "prompt-management", "versioned-prompts", "file-based-prompts", "variable-interpolation", "performance-tracking", "ab-testing", - "laravel", - "laravel-package" + "victor-ukam" ], "require": { "php": "^8.2", From 9603e08be62759d2996d3a5a1f5590375a2e102f Mon Sep 17 00:00:00 2001 From: Victor Ukam Date: Fri, 27 Mar 2026 15:37:47 +0000 Subject: [PATCH 3/6] Add badge for Laravel News feature in README --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 002871c..6171882 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ Latest Version on Packagist PHP from Packagist GitHub license + + https://laravel-news.com/prompt-deck-manage-ai-prompts-as-versioned-files-in-laravel +

## Introduction @@ -102,7 +105,7 @@ class OrderAgent extends Agent { use HasPromptTemplate; - // instructions() and promptMessages() are provided automatically + // instructions() and promptMessages() are provided automatically. } ``` @@ -134,4 +137,4 @@ Prompt Deck is open-sourced software licensed under the [MIT license](LICENSE). ## Support -This library is created by [Victor Ukam](https://victorukam.com) with contributions from the [Open Source Community](https://github.com/veeqtoh/prompt-deck/graphs/contributors). If you've found this package useful, please consider [sponsoring this project](https://github.com/sponsors/veeqtoh). It will go along way to help with maintenance. +This library is created by [Victor Ukam](https://victorukam.com) with contributions from the [Open Source Community](https://github.com/veeqtoh/prompt-deck/graphs/contributors). If you've found this package useful, please consider [sponsoring this project](https://github.com/sponsors/veeqtoh). It will go a long way to help with maintenance. From 3aff359df9cc864c8c0c753da32a8ab21cef38f7 Mon Sep 17 00:00:00 2001 From: Victor Ukam Date: Fri, 27 Mar 2026 23:41:13 +0000 Subject: [PATCH 4/6] Add CHANGELOG file to document project updates and adhere to versioning standards --- CHANGELOG.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b6af045 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,38 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## [Unreleased] + +### Added + +### Changed + +### Removed + + +## [0.2.0] - 2026-03-27 + +### Added + +- Support for Laravel 13. [#3](https://github.com/veeqtoh/prompt-deck/pull/3) +- Configuration option to toggle auto-scaffolding of prompts on agent creation +- This CHANGELOG file to hopefully serve as an evolving CHANGELOG. + + +### Fixed + +- Documentation. + + +## [0.1.0] - 2026-03-04 + +### Added + +- First version. [#1](https://github.com/veeqtoh/prompt-deck/pull/1) +- README documenting the package. +- Link to package's full documentation: [full documentation](https://vu-ddaf4ff3.mintlify.app/). From 0fd43f91b5d65f2879f9ddcc0fa371e8bda44a40 Mon Sep 17 00:00:00 2001 From: Victor Ukam Date: Sat, 28 Mar 2026 00:07:20 +0000 Subject: [PATCH 5/6] Add GitHub Actions workflow for automated testing --- .github/workflows/tests.yml | 47 ++++++ CHANGELOG.md | 15 +- composer.json | 10 +- docs/api-reference.md | 141 ++++++++++-------- .../Factories}/PromptExecutionFactory.php | 0 .../Factories}/PromptVersionFactory.php | 0 ...02_28_0000001_create_prompt_executions.php | 0 ...5_02_28_0000001_create_prompt_versions.php | 0 src/Exceptions/ConfigurationException.php | 2 +- src/Exceptions/InvalidVersionException.php | 2 +- src/Exceptions/PromptDeckException.php | 2 +- src/Exceptions/PromptNotFoundException.php | 2 +- src/Exceptions/PromptRenderingException.php | 2 +- src/Models/PromptExecution.php | 5 +- src/Models/PromptVersion.php | 5 +- tests/Feature/MigrationTest.php | 4 +- tests/Unit/ExceptionsTest.php | 22 +-- 17 files changed, 168 insertions(+), 91 deletions(-) create mode 100644 .github/workflows/tests.yml rename src/{database/factories => Database/Factories}/PromptExecutionFactory.php (100%) rename src/{database/factories => Database/Factories}/PromptVersionFactory.php (100%) rename src/{database => Database}/migrations/2025_02_28_0000001_create_prompt_executions.php (100%) rename src/{database => Database}/migrations/2025_02_28_0000001_create_prompt_versions.php (100%) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..1f123aa --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,47 @@ +name: tests + +on: + push: + branches: + - main + - "*.x" + pull_request: + +jobs: + tests: + name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} + runs-on: ubuntu-24.04 + + strategy: + fail-fast: true + matrix: + php: ["8.3", "8.4", "8.5"] + laravel: [12, 13] + include: + - laravel: 12 + testbench: "^10.0" + - laravel: 13 + testbench: "^11.0" + exclude: + - php: "8.5" + laravel: 12 + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer:v2 + coverage: none + + - name: Install dependencies + run: | + composer update --prefer-dist --no-interaction --no-progress \ + --with="illuminate/contracts=^${{ matrix.laravel }}.0" \ + --with="orchestra/testbench=${{ matrix.testbench }}" + + - name: Execute tests + run: vendor/bin/pest diff --git a/CHANGELOG.md b/CHANGELOG.md index b6af045..a51a6d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,6 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - ## [Unreleased] ### Added @@ -14,6 +13,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed +## [0.2.1] - 2026-03-28 + +### Added + +- This CHANGELOG file to hopefully serve as an evolving CHANGELOG. +- GitHub Actions workflow for automated testing. + +### Fixed + +- README and documentation. ## [0.2.0] - 2026-03-27 @@ -23,11 +32,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Configuration option to toggle auto-scaffolding of prompts on agent creation - This CHANGELOG file to hopefully serve as an evolving CHANGELOG. - ### Fixed -- Documentation. - +- README and documentation. ## [0.1.0] - 2026-03-04 diff --git a/composer.json b/composer.json index 60b562d..40e3bba 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,10 @@ "type": "library", "homepage": "https://github.com/veeqtoh/prompt-deck", "license": "MIT", + "support": { + "issues": "https://github.com/veeqtoh/prompt-deck/issues", + "source": "https://github.com/veeqtoh/prompt-deck" + }, "authors": [ { "name": "Victor Ukam", @@ -36,7 +40,7 @@ }, "require-dev": { "mockery/mockery": "^1.0", - "orchestra/testbench": "^10.0", + "orchestra/testbench": "^10.0|^11.0", "pestphp/pest": "^4.3", "pestphp/pest-plugin-laravel": "^4.0", "laravel/pint": "^1.27" @@ -46,7 +50,9 @@ }, "autoload": { "psr-4": { - "Veeqtoh\\PromptDeck\\": "src/" + "Veeqtoh\\PromptDeck\\": "src/", + "Veeqtoh\\PromptDeck\\Database\\Factories\\": "src/database/factories/", + "Veeqtoh\\PromptDeck\\Database\\Seeders\\": "src/database/seeders/" } }, "autoload-dev": { diff --git a/docs/api-reference.md b/docs/api-reference.md index 24d5a78..4074ca2 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -7,18 +7,19 @@ - [TrackPromptMiddleware](#trackpromptmiddleware) - [AfterMakeAgent Listener](#aftermakeagent-listener) - [Models](#models) - - [PromptVersion](#prompt-version) - - [PromptExecution](#prompt-execution) + - [PromptVersion](#prompt-version) + - [PromptExecution](#prompt-execution) - [Exceptions](#exceptions) - - [PromptDeckException](#promptdeckexception) - - [PromptNotFoundException](#promptnotfoundexception) - - [InvalidVersionException](#invalidversionexception) - - [ConfigurationException](#configurationexception) - - [PromptRenderingException](#promptrenderingexception) + - [PromptDeckException](#promptdeckexception) + - [PromptNotFoundException](#promptnotfoundexception) + - [InvalidVersionException](#invalidversionexception) + - [ConfigurationException](#configurationexception) + - [PromptRenderingException](#promptrenderingexception) --- + ## PromptManager `Veeqtoh\PromptDeck\PromptManager` @@ -36,12 +37,12 @@ public function __construct( ) ``` -| Parameter | Type | Description | -|---|---|---| -| `$basePath` | `string` | Base directory where prompt files are stored. | -| `$extension` | `string` | File extension for prompt templates (e.g. `md`). | -| `$cache` | `Illuminate\Contracts\Cache\Repository` | Cache store instance. | -| `$config` | `Illuminate\Contracts\Config\Repository` | Configuration repository. | +| Parameter | Type | Description | +| ------------ | ---------------------------------------- | ------------------------------------------------ | +| `$basePath` | `string` | Base directory where prompt files are stored. | +| `$extension` | `string` | File extension for prompt templates (e.g. `md`). | +| `$cache` | `Illuminate\Contracts\Cache\Repository` | Cache store instance. | +| `$config` | `Illuminate\Contracts\Config\Repository` | Configuration repository. | ### Methods @@ -111,6 +112,7 @@ $manager->track('order-summary', 2, [ --- + ## PromptTemplate `Veeqtoh\PromptDeck\PromptTemplate` @@ -128,12 +130,12 @@ public function __construct( ) ``` -| Parameter | Type | Description | -|---|---|---| -| `$name` | `string` | The prompt name. | -| `$version` | `int` | The resolved version number. | -| `$roles` | `array` | Role name → raw content map. | -| `$metadata` | `array` | Prompt metadata from `metadata.json`. | +| Parameter | Type | Description | +| ----------- | ----------------------- | ------------------------------------- | +| `$name` | `string` | The prompt name. | +| `$version` | `int` | The resolved version number. | +| `$roles` | `array` | Role name → raw content map. | +| `$metadata` | `array` | Prompt metadata from `metadata.json`. | ### Methods @@ -175,10 +177,10 @@ $prompt->roles(); // ['system', 'user', 'assistant'] Build a messages array for AI API consumption. Returns an array of `['role' => '...', 'content' => '...']` entries. -| Parameter | Type | Description | -|---|---|---| -| `$variables` | `array` | Variables to interpolate into every role. | -| `$only` | `array\|null` | Limit to these roles (preserves order). `null` = all roles. | +| Parameter | Type | Description | +| ------------ | ------------- | ----------------------------------------------------------- | +| `$variables` | `array` | Variables to interpolate into every role. | +| `$only` | `array\|null` | Limit to these roles (preserves order). `null` = all roles. | ```php $messages = $prompt->toMessages(['tone' => 'concise'], ['system', 'user']); @@ -230,6 +232,7 @@ $prompt->custom_role(); // renders 'custom_role' role --- + ## PromptDeck Facade `Veeqtoh\PromptDeck\Facades\PromptDeck` @@ -238,17 +241,18 @@ Static proxy to the `PromptManager` singleton. ### Available Methods -| Method | Returns | Description | -|---|---|---| -| `PromptDeck::get(string $name, ?int $version = null)` | `PromptTemplate` | Load a prompt by name and optional version. | -| `PromptDeck::active(string $name)` | `PromptTemplate` | Load the active version of a prompt. | -| `PromptDeck::versions(string $name)` | `array` | List all versions for a prompt. | -| `PromptDeck::activate(string $name, int $version)` | `bool` | Activate a specific version. | -| `PromptDeck::track(string $name, int $version, array $data)` | `void` | Record a prompt execution. | +| Method | Returns | Description | +| ------------------------------------------------------------ | ---------------- | ------------------------------------------- | +| `PromptDeck::get(string $name, ?int $version = null)` | `PromptTemplate` | Load a prompt by name and optional version. | +| `PromptDeck::active(string $name)` | `PromptTemplate` | Load the active version of a prompt. | +| `PromptDeck::versions(string $name)` | `array` | List all versions for a prompt. | +| `PromptDeck::activate(string $name, int $version)` | `bool` | Activate a specific version. | +| `PromptDeck::track(string $name, int $version, array $data)` | `void` | Record a prompt execution. | --- + ## HasPromptTemplate Trait `Veeqtoh\PromptDeck\Concerns\HasPromptTemplate` @@ -285,9 +289,9 @@ Get the system instructions from the prompt template. Loads the `system` role an Get prompt roles as messages. By default returns all roles except `system`. Returns `Message[]` when the AI SDK is installed, or raw `['role' => '...', 'content' => '...']` arrays otherwise. -| Parameter | Type | Description | -|---|---|---| -| `$only` | `array\|null` | Limit to specific roles. `null` = all non-system roles. | +| Parameter | Type | Description | +| --------- | ------------- | ------------------------------------------------------- | +| `$only` | `array\|null` | Limit to specific roles. `null` = all non-system roles. | #### `forgetPromptTemplate(): static` @@ -296,6 +300,7 @@ Clear the cached `PromptTemplate`, forcing a fresh load on next access. Returns --- + ## TrackPromptMiddleware `Veeqtoh\PromptDeck\Ai\TrackPromptMiddleware` @@ -313,6 +318,7 @@ Only tracks agents that use the `HasPromptTemplate` trait (i.e. agents with a `p --- + ## AfterMakeAgent Listener `Veeqtoh\PromptDeck\Listeners\AfterMakeAgent` @@ -328,95 +334,104 @@ Handle the `CommandFinished` event. Only acts on successful `make:agent` command --- + ## Models + ### PromptVersion `Veeqtoh\PromptDeck\Models\PromptVersion` -| Attribute | Type | Cast | Description | -|---|---|---|---| -| `name` | `string` | — | Prompt name. | -| `version` | `int` | `integer` | Version number. | -| `system_prompt` | `string\|null` | — | System prompt content. | -| `user_prompt` | `string` | — | User prompt content. | -| `metadata` | `array\|null` | `array` | Version metadata. | -| `is_active` | `bool` | `boolean` | Whether this is the active version. | +| Attribute | Type | Cast | Description | +| --------------- | -------------- | --------- | ----------------------------------- | +| `name` | `string` | — | Prompt name. | +| `version` | `int` | `integer` | Version number. | +| `system_prompt` | `string\|null` | — | System prompt content. | +| `user_prompt` | `string` | — | User prompt content. | +| `metadata` | `array\|null` | `array` | Version metadata. | +| `is_active` | `bool` | `boolean` | Whether this is the active version. | + ### PromptExecution `Veeqtoh\PromptDeck\Models\PromptExecution` -| Attribute | Type | Cast | Description | -|---|---|---|---| -| `prompt_name` | `string` | — | Prompt name. | -| `prompt_version` | `int` | `integer` | Version number. | -| `input` | `array\|null` | `array` | Input data (JSON). | -| `output` | `string\|null` | — | Response text. | -| `tokens` | `int\|null` | `integer` | Total tokens. | -| `latency_ms` | `int\|null` | `integer` | Latency in milliseconds. | -| `cost` | `string\|null` | `decimal:6` | Cost (6 decimal places). | -| `model` | `string\|null` | — | AI model used. | -| `provider` | `string\|null` | — | AI provider. | -| `feedback` | `array\|null` | `array` | Feedback data (JSON). | +| Attribute | Type | Cast | Description | +| ---------------- | -------------- | ----------- | ------------------------ | +| `prompt_name` | `string` | — | Prompt name. | +| `prompt_version` | `int` | `integer` | Version number. | +| `input` | `array\|null` | `array` | Input data (JSON). | +| `output` | `string\|null` | — | Response text. | +| `tokens` | `int\|null` | `integer` | Total tokens. | +| `latency_ms` | `int\|null` | `integer` | Latency in milliseconds. | +| `cost` | `string\|null` | `decimal:6` | Cost (6 decimal places). | +| `model` | `string\|null` | — | AI model used. | +| `provider` | `string\|null` | — | AI provider. | +| `feedback` | `array\|null` | `array` | Feedback data (JSON). | --- + ## Exceptions All Prompt Deck exceptions extend the base `PromptDeckException` class. + ### PromptDeckException -`Veeqtoh\PromptDeck\Exceptions\PROMPTDECKException` +`Veeqtoh\PromptDeck\Exceptions\PromptDeckException` Abstract base exception for all Prompt Deck errors. Extends PHP's `Exception` class. + ### PromptNotFoundException `Veeqtoh\PromptDeck\Exceptions\PromptNotFoundException` Thrown when a prompt directory does not exist. -| Factory Method | Description | -|---|---| +| Factory Method | Description | +| --------------------------- | -------------------------------------------------------------- | | `named(string $name): self` | Creates exception with message: `"Prompt [{name}] not found."` | + ### InvalidVersionException `Veeqtoh\PromptDeck\Exceptions\InvalidVersionException` Thrown when a requested version does not exist or no versions are found. -| Factory Method | Description | -|---|---| +| Factory Method | Description | +| --------------------------------------------- | ----------------------------------------------------------------------------------------- | | `forPrompt(string $name, int $version): self` | Creates exception with message: `"Version {version} for prompt [{name}] does not exist."` | -| `noVersions(string $name): self` | Creates exception with message: `"No versions found for prompt [{name}]."` | +| `noVersions(string $name): self` | Creates exception with message: `"No versions found for prompt [{name}]."` | + ### ConfigurationException `Veeqtoh\PromptDeck\Exceptions\ConfigurationException` Thrown when Prompt Deck configuration is invalid. -| Factory Method | Description | -|---|---| +| Factory Method | Description | +| --------------------------------- | ------------------------------------------------------------------------------------------------ | | `invalidPath(string $path): self` | Creates exception with message: `"Prompts path [{path}] is not a directory or is not writable."` | + ### PromptRenderingException `Veeqtoh\PromptDeck\Exceptions\PromptRenderingException` Thrown when prompt rendering fails. -| Factory Method | Description | -|---|---| +| Factory Method | Description | +| ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- | | `dueToMissingVariable(string $variable, string $promptName): self` | Creates exception with message: `"Cannot render prompt [{promptName}]: missing required variable '{variable}'."` | diff --git a/src/database/factories/PromptExecutionFactory.php b/src/Database/Factories/PromptExecutionFactory.php similarity index 100% rename from src/database/factories/PromptExecutionFactory.php rename to src/Database/Factories/PromptExecutionFactory.php diff --git a/src/database/factories/PromptVersionFactory.php b/src/Database/Factories/PromptVersionFactory.php similarity index 100% rename from src/database/factories/PromptVersionFactory.php rename to src/Database/Factories/PromptVersionFactory.php diff --git a/src/database/migrations/2025_02_28_0000001_create_prompt_executions.php b/src/Database/migrations/2025_02_28_0000001_create_prompt_executions.php similarity index 100% rename from src/database/migrations/2025_02_28_0000001_create_prompt_executions.php rename to src/Database/migrations/2025_02_28_0000001_create_prompt_executions.php diff --git a/src/database/migrations/2025_02_28_0000001_create_prompt_versions.php b/src/Database/migrations/2025_02_28_0000001_create_prompt_versions.php similarity index 100% rename from src/database/migrations/2025_02_28_0000001_create_prompt_versions.php rename to src/Database/migrations/2025_02_28_0000001_create_prompt_versions.php diff --git a/src/Exceptions/ConfigurationException.php b/src/Exceptions/ConfigurationException.php index 8066147..e86ece3 100644 --- a/src/Exceptions/ConfigurationException.php +++ b/src/Exceptions/ConfigurationException.php @@ -4,7 +4,7 @@ namespace Veeqtoh\PromptDeck\Exceptions; -class ConfigurationException extends PROMPTDECKException +class ConfigurationException extends PromptDeckException { /** * Create a new exception for an invalid prompts path configuration. diff --git a/src/Exceptions/InvalidVersionException.php b/src/Exceptions/InvalidVersionException.php index b38b0d1..7963cce 100644 --- a/src/Exceptions/InvalidVersionException.php +++ b/src/Exceptions/InvalidVersionException.php @@ -4,7 +4,7 @@ namespace Veeqtoh\PromptDeck\Exceptions; -class InvalidVersionException extends PROMPTDECKException +class InvalidVersionException extends PromptDeckException { /** * * Create an exception for a non-existent version. diff --git a/src/Exceptions/PromptDeckException.php b/src/Exceptions/PromptDeckException.php index 3ccd1e4..628ad6b 100644 --- a/src/Exceptions/PromptDeckException.php +++ b/src/Exceptions/PromptDeckException.php @@ -6,7 +6,7 @@ use Exception; -abstract class PROMPTDECKException extends Exception +abstract class PromptDeckException extends Exception { // } diff --git a/src/Exceptions/PromptNotFoundException.php b/src/Exceptions/PromptNotFoundException.php index 8528a73..17f245b 100644 --- a/src/Exceptions/PromptNotFoundException.php +++ b/src/Exceptions/PromptNotFoundException.php @@ -4,7 +4,7 @@ namespace Veeqtoh\PromptDeck\Exceptions; -class PromptNotFoundException extends PROMPTDECKException +class PromptNotFoundException extends PromptDeckException { /** * Create a new exception instance for a missing prompt. diff --git a/src/Exceptions/PromptRenderingException.php b/src/Exceptions/PromptRenderingException.php index 66d2176..4aa454c 100644 --- a/src/Exceptions/PromptRenderingException.php +++ b/src/Exceptions/PromptRenderingException.php @@ -4,7 +4,7 @@ namespace Veeqtoh\PromptDeck\Exceptions; -class PromptRenderingException extends PROMPTDECKException +class PromptRenderingException extends PromptDeckException { /** * Create a new exception for a missing variable during prompt rendering. diff --git a/src/Models/PromptExecution.php b/src/Models/PromptExecution.php index 1164fc3..4e3d450 100644 --- a/src/Models/PromptExecution.php +++ b/src/Models/PromptExecution.php @@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Veeqtoh\PromptDeck\Database\Factories\PromptExecutionFactory; class PromptExecution extends Model { @@ -38,8 +39,8 @@ class PromptExecution extends Model /** * Create a new factory instance for the model. */ - protected static function newFactory(): \Veeqtoh\PromptDeck\Database\Factories\PromptExecutionFactory + protected static function newFactory(): PromptExecutionFactory { - return \Veeqtoh\PromptDeck\Database\Factories\PromptExecutionFactory::new(); + return PromptExecutionFactory::new(); } } diff --git a/src/Models/PromptVersion.php b/src/Models/PromptVersion.php index 9b6f76f..6570dd9 100644 --- a/src/Models/PromptVersion.php +++ b/src/Models/PromptVersion.php @@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Veeqtoh\PromptDeck\Database\Factories\PromptVersionFactory; class PromptVersion extends Model { @@ -29,8 +30,8 @@ class PromptVersion extends Model /** * Create a new factory instance for the model. */ - protected static function newFactory(): \Veeqtoh\PromptDeck\Database\Factories\PromptVersionFactory + protected static function newFactory(): PromptVersionFactory { - return \Veeqtoh\PromptDeck\Database\Factories\PromptVersionFactory::new(); + return PromptVersionFactory::new(); } } diff --git a/tests/Feature/MigrationTest.php b/tests/Feature/MigrationTest.php index e6d7c8f..34f8c3b 100644 --- a/tests/Feature/MigrationTest.php +++ b/tests/Feature/MigrationTest.php @@ -15,7 +15,7 @@ function runMigrations(): void { - $migrationsPath = realpath(__DIR__.'/../../src/database/migrations'); + $migrationsPath = realpath(__DIR__.'/../../src/Database/migrations'); test()->artisan('migrate', [ '--path' => $migrationsPath, @@ -26,7 +26,7 @@ function runMigrations(): void function rollbackMigrations(): void { - $migrationsPath = realpath(__DIR__.'/../../src/database/migrations'); + $migrationsPath = realpath(__DIR__.'/../../src/Database/migrations'); test()->artisan('migrate:rollback', [ '--path' => $migrationsPath, diff --git a/tests/Unit/ExceptionsTest.php b/tests/Unit/ExceptionsTest.php index 808b4ed..2446bed 100644 --- a/tests/Unit/ExceptionsTest.php +++ b/tests/Unit/ExceptionsTest.php @@ -4,40 +4,40 @@ use Veeqtoh\PromptDeck\Exceptions\ConfigurationException; use Veeqtoh\PromptDeck\Exceptions\InvalidVersionException; -use Veeqtoh\PromptDeck\Exceptions\PROMPTDECKException; +use Veeqtoh\PromptDeck\Exceptions\PromptDeckException; use Veeqtoh\PromptDeck\Exceptions\PromptNotFoundException; use Veeqtoh\PromptDeck\Exceptions\PromptRenderingException; // --- Hierarchy --- -test('PROMPTDECKException extends base Exception', function () { - expect(PROMPTDECKException::class) +test('PromptDeckException extends base Exception', function () { + expect(PromptDeckException::class) ->toExtend(\Exception::class); }); -test('ConfigurationException extends PROMPTDECKException', function () { +test('ConfigurationException extends PromptDeckException', function () { $e = ConfigurationException::invalidPath('/some/path'); - expect($e)->toBeInstanceOf(PROMPTDECKException::class) + expect($e)->toBeInstanceOf(PromptDeckException::class) ->and($e)->toBeInstanceOf(\Exception::class); }); -test('InvalidVersionException extends PROMPTDECKException', function () { +test('InvalidVersionException extends PromptDeckException', function () { $e = InvalidVersionException::forPrompt('test', 1); - expect($e)->toBeInstanceOf(PROMPTDECKException::class); + expect($e)->toBeInstanceOf(PromptDeckException::class); }); -test('PromptNotFoundException extends PROMPTDECKException', function () { +test('PromptNotFoundException extends PromptDeckException', function () { $e = PromptNotFoundException::named('test'); - expect($e)->toBeInstanceOf(PROMPTDECKException::class); + expect($e)->toBeInstanceOf(PromptDeckException::class); }); -test('PromptRenderingException extends PROMPTDECKException', function () { +test('PromptRenderingException extends PromptDeckException', function () { $e = PromptRenderingException::dueToMissingVariable('name', 'greeting'); - expect($e)->toBeInstanceOf(PROMPTDECKException::class); + expect($e)->toBeInstanceOf(PromptDeckException::class); }); // --- Message format --- From 3bb32d43881c508fde22a148843d6af457c724f8 Mon Sep 17 00:00:00 2001 From: Victor Ukam Date: Sat, 28 Mar 2026 01:31:36 +0000 Subject: [PATCH 6/6] Add .gitattributes file to manage text file handling and export-ignore rules --- .gitattributes | 17 +++++++++++++++++ CHANGELOG.md | 1 + 2 files changed, 18 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..22f987d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,17 @@ +* text=auto + +*.blade.php diff=html +*.css diff=css +*.html diff=html +*.md diff=markdown +*.php diff=php + +/.github export-ignore +/docs export-ignore +/tests export-ignore +.editorconfig export-ignore +.gitattributes export-ignore +.gitignore export-ignore +CHANGELOG.md export-ignore +phpunit.xml.dist export-ignore +UPGRADE.md export-ignore \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a51a6d1..2040171 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - This CHANGELOG file to hopefully serve as an evolving CHANGELOG. - GitHub Actions workflow for automated testing. +- `.gitattributes` file to manage text file handling and export-ignore rules. ### Fixed