Modify admin routes to make saner, remove TokensController
This commit is contained in:
parent
11c03d33c2
commit
b255987423
2 changed files with 48 additions and 100 deletions
|
@ -1,61 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Services\TokenService;
|
||||
|
||||
class TokensController extends Controller
|
||||
{
|
||||
/**
|
||||
* The token service container.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $tokenService;
|
||||
|
||||
/**
|
||||
* Inject the service dependency.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(TokenService $tokenService = null)
|
||||
{
|
||||
$this->tokenService = $tokenService ?? new TokenService();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the saved tokens.
|
||||
*
|
||||
* @return \Illuminate\View\Factory view
|
||||
*/
|
||||
public function showTokens()
|
||||
{
|
||||
$tokens = $$his->tokenService->getAll();
|
||||
|
||||
return view('admin.listtokens', ['tokens' => $tokens]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form to delete a certain token.
|
||||
*
|
||||
* @param string The token id
|
||||
* @return \Illuminate\View\Factory view
|
||||
*/
|
||||
public function deleteToken($tokenId)
|
||||
{
|
||||
return view('admin.deletetoken', ['id' => $tokenId]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the request to delete a token.
|
||||
*
|
||||
* @param string The token id
|
||||
* @return \Illuminate\View\Factory view
|
||||
*/
|
||||
public function postDeleteToken($tokenId)
|
||||
{
|
||||
$this->tokenService->deleteToken($tokenId);
|
||||
|
||||
return view('admin.deletetokensuccess', ['id' => $tokenId]);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue