httpoz / hook
Package for allowing and monitoring a[pp access.
v0.4.0
2018-03-26 13:15 UTC
Requires
- php: >=7.1.3
- illuminate/database: ~5.0
- illuminate/support: ~5.0
- webpatser/laravel-uuid: ^3.0
Requires (Dev)
- orchestra/database: ~3.6.0
- orchestra/testbench: ~3.6.0
- phpunit/phpunit: ~7.0
This package is auto-updated.
Last update: 2024-11-05 21:28:15 UTC
README
Installation
Composer
Add the package to your project via composer.
composer require httpoz/hooks
Publish
Run this to publish the package's migrations
php artisan vendor:publish --provider="HttpOz\Hook\HookServiceProvider"
Middleware
This package comes with ValidateHookMiddleware
. You need to add it to your app/Http/Kernel.php
.
<?php /** * The application's route middleware. * * @var array */ protected $routeMiddleware = [ // ... 'validateHook' => \HttpOz\Hook\Http\Middleware\ValidateHookMiddleware::class, ];
Now you can add this middleware to your routes. You will also need the prefix, you can call it anything you want but the hook id itself should be the second segment in your url.
<?php // Route group Route::group(['prefix' => 'hooks/{hook}', 'middleware' => 'validateHook'], function(){ Route::resource('notification', 'NotificationController'); });