This is a laravel package for validating URLs with OTPs.
- Change Token
- Require token middleware
- Notifications
- Token change notification
- PHP 8+
- Laravel 9+
composer require ikechukwukalu/tokenmiddleware
- You will need a queue worker for the notifications. For a quick start set
QUEUE_CONNECTION=database
within your.env
file. - Run
php artisan queue:table
,php artisan migrate
andphp artisan queue:work --queue=high,default
- Add
token
column to thefillable
andhidden
arrays within theUser
model class - Add
'require.token' => \Ikechukwukalu\Sanctumauthstarter\Middleware\RequireToken::class
to the$routeMiddleware
inkernel.php
- Run
php artisan serve
It's recommended that you run the tests before you start adding your models and controllers.
Make sure to keep your database/factories/UserFactory.php
Class updated with your users
table so that the Tests can continue to run successfully.
php artisan vendor:publish --tag=tm-feature-tests
php artisan serve
php artisan test
_uuid
_token
expires
signature
Some of the reserved keywords can be changed from the config file.
To generate documentation:
php artisan vendor:publish --tag=scribe-config
php artisan scribe:generate
Visit your newly generated docs:
- If you're using
static
type, find thedocs/index.html
file in yourpublic/
folder and open it in your browser. - If you're using
laravel
type, start your app (php artisan serve
), then visit/docs
.
example_languages
:
For each endpoint, an example request is shown in each of the languages specified in this array. Currently, only bash
(curl), javascript
(Fetch), php
(Guzzle) and python
(requests) are included. You can add extra languages, but you must also create the corresponding Blade view (see Adding more example languages).
Default: ["bash", "javascript"]
Please visit scribe for more details.
php artisan vendor:publish --tag=tm-controllers
php artisan vendor:publish --tag=tm-models
php artisan vendor:publish --tag=tm-middleware
php artisan vendor:publish --tag=tm-rules
php artisan vendor:publish --tag=tm-routes
php artisan vendor:publish --tag=tm-lang
php artisan vendor:publish --tag=tm-config
php artisan vendor:publish --tag=laravel-notifications
The Laravel package is an open-sourced software licensed under the MIT license.