1. Go to this page and download the library: Download uteq/signature library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
class Action
{
public function __invoke($payload)
{
// Do something
return redirect('login');
}
}
return [
/*
* This will be the url Signature will use to handle the actions
* if the action_route is action the url will for example be https://example.com/action/{key}
*/
'action_route' => '/action/{key}',
/*
* Here you can optionaly define the actions, for example: 'action => '\App\SignatureActions\Action'
* When making a url you can provide the key instead of the class path,
* when using the example above it would look like SignatureFacade::make('action', $payload)->get();
*/
'actions' => [
]
];
class Action
{
public function __invoke($payload)
{
// from here on you can use the variables in $payload to make the link actually do something;
return redirect('/login'); // If no return is provided the user will be redirected to "/".
}
}