2021-03-09 12:29:49 +00:00
|
|
|
<?php
|
2021-03-09 12:38:19 +00:00
|
|
|
namespace Backend\Controllers;
|
2021-03-09 12:29:49 +00:00
|
|
|
require "../../../bootstrap.php";
|
|
|
|
|
|
|
|
use Backend\Models\Group;
|
|
|
|
use Backend\Models\Password;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $token
|
|
|
|
* @return Group;
|
|
|
|
*/
|
|
|
|
|
|
|
|
function groupViaToken(string $token){
|
|
|
|
|
|
|
|
$password = Password::firstWhere('remember_token', $token);
|
|
|
|
return Group::find($password->group_id);
|
|
|
|
}
|