{"id":22591451,"url":"https://github.com/netsells/dredd-hooks-laravel","last_synced_at":"2025-04-10T23:22:23.016Z","repository":{"id":50878390,"uuid":"122386291","full_name":"netsells/dredd-hooks-laravel","owner":"netsells","description":"A clean way to add your dredd hooks when using Laravel","archived":false,"fork":false,"pushed_at":"2021-05-28T06:24:16.000Z","size":18,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-24T20:11:20.417Z","etag":null,"topics":["dredd","dredd-hooks","laravel","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/netsells.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-21T19:57:52.000Z","updated_at":"2021-05-28T06:24:19.000Z","dependencies_parsed_at":"2022-08-28T03:20:36.449Z","dependency_job_id":null,"html_url":"https://github.com/netsells/dredd-hooks-laravel","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netsells%2Fdredd-hooks-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netsells%2Fdredd-hooks-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netsells%2Fdredd-hooks-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netsells%2Fdredd-hooks-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netsells","download_url":"https://codeload.github.com/netsells/dredd-hooks-laravel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248244876,"owners_count":21071352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dredd","dredd-hooks","laravel","php"],"created_at":"2024-12-08T09:12:44.006Z","updated_at":"2025-04-10T23:22:22.998Z","avatar_url":"https://github.com/netsells.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Hooks for Dredd API Testing Framework\n[![Packagist](https://img.shields.io/packagist/v/netsells/dredd-hooks-laravel.svg)](https://packagist.org/packages/netsells/dredd-hooks-laravel)\n[![Packagist](https://img.shields.io/packagist/dt/netsells/dredd-hooks-laravel.svg)](https://packagist.org/packages/netsells/dredd-hooks-laravel)\n[![license](https://img.shields.io/github/license/netsells/dredd-hooks-laravel.svg)]()\n\nThis package contains a PHP Dredd hook handler which provides a bridge between the [Dredd API Testing Framework](http://dredd.readthedocs.org/en/latest/)\n and PHP environment to ease implementation of testing hooks provided by [Dredd](http://dredd.readthedocs.org/en/latest/). Most of the heavy lifting is provided by the [ddelnano/dredd-hooks-php](https://github.com/ddelnano/dredd-hooks-php) package.\n \n It is created and maintained by the [Netsells team](https://netsells.co.uk/)\n\n## Installation\n### Composer\n\nLaravel Hooks for Dredd should be installed via composer, we recommend you put this in your require-dev section.\n\n```bash\ncomposer require netsells/dredd-hooks-laravel --dev\n```\n\n### Dredd Setup\nIn order to inject environment variables and use the full power of Larvel Dredd Hooks, you need to add the following to your `dredd.yml` file (or put in your console arguments).\n\n```yml\n# This can be any single file which extends Netsells\\Dredd\\Kernel\nhookfiles: 'tests/dredd/Kernel.php'\n\nlanguage: 'vendor/bin/dredd-hooks-laravel'\nserver: 'php -S 127.0.0.1:3000 ./vendor/netsells/dredd-hooks-laravel/server.php -t public/'\nendpoint: 'http://127.0.0.1:3000'\n```\n\n## Usage\n\nThe package requires you to make a single file (named in the `hookfiles` part of dredd.yml above). This should have at least the `handle` method.\n\n```php\n\u003c?php\n\nnamespace Tests\\Dredd;\n\nuse Netsells\\Dredd\\Hook;\nuse Netsells\\Dredd\\Transaction;\nuse Illuminate\\Support\\Facades\\Artisan;\nuse Netsells\\Dredd\\Kernel as DreddKernel;\n\nclass Kernel extends DreddKernel\n{\n    public function handle(Hook $hook)\n    {\n        $this-\u003ebeforeEach(function (Transaction \u0026$transaction) {\n            Artisan::call('migrate:fresh');\n            Artisan::call('passport:install');\n\n            Artisan::call('db:seed');\n        });\n\n        $hook-\u003egroup('Posts', Hooks\\Posts::class);\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetsells%2Fdredd-hooks-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetsells%2Fdredd-hooks-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetsells%2Fdredd-hooks-laravel/lists"}