Improved subscriber handling

- Signed routes
- Manage subscriptions now sends an email link
This commit is contained in:
James Brooks
2019-07-12 11:39:13 +01:00
parent 29d640e74b
commit 7f53a7e9df
8 changed files with 112 additions and 22 deletions
+21 -1
View File
@@ -123,6 +123,22 @@ if (!function_exists('color_contrast')) {
}
}
if (!function_exists('cachet_route_generator')) {
/**
* Generate the route string.
*
* @param string $name
* @param string $method
* @param string $domain
*
* @return string
*/
function cachet_route_generator($name, $method = 'get', $domain = 'core')
{
return "{$domain}::{$method}:{$name}";
}
}
if (!function_exists('cachet_route')) {
/**
* Generate a URL to a named route, which resides in a given domain.
@@ -136,7 +152,11 @@ if (!function_exists('cachet_route')) {
*/
function cachet_route($name, $parameters = [], $method = 'get', $domain = 'core')
{
return app('url')->route("{$domain}::{$method}:{$name}", $parameters, true);
return app('url')->route(
cachet_route_generator($name, $method, $domain),
$parameters,
true
);
}
}