2016-01-05 04:59:45 +00:00
|
|
|
<?php
|
2016-01-20 00:10:39 +00:00
|
|
|
/**
|
2016-01-20 21:05:16 +00:00
|
|
|
* Pterodactyl - Panel
|
2017-01-24 22:57:08 +00:00
|
|
|
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
2016-01-20 00:10:39 +00:00
|
|
|
*
|
2016-01-20 20:56:40 +00:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
2016-01-20 00:10:39 +00:00
|
|
|
*
|
2016-01-20 20:56:40 +00:00
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
2016-01-20 00:10:39 +00:00
|
|
|
*
|
2016-01-20 20:56:40 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
2016-01-20 00:10:39 +00:00
|
|
|
*/
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2016-01-05 04:59:45 +00:00
|
|
|
namespace Pterodactyl\Http\Controllers\Admin;
|
|
|
|
|
2017-08-05 22:20:07 +00:00
|
|
|
use Illuminate\Cache\Repository as CacheRepository;
|
|
|
|
use Illuminate\Contracts\Translation\Translator;
|
2016-12-07 22:46:38 +00:00
|
|
|
use Log;
|
|
|
|
use Alert;
|
2017-05-01 18:21:18 +00:00
|
|
|
use Cache;
|
2017-03-03 22:30:39 +00:00
|
|
|
use Javascript;
|
2017-08-05 22:20:07 +00:00
|
|
|
use Prologue\Alerts\AlertsMessageBag;
|
|
|
|
use Pterodactyl\Contracts\Repository\LocationRepositoryInterface;
|
|
|
|
use Pterodactyl\Contracts\Repository\NodeRepositoryInterface;
|
|
|
|
use Pterodactyl\Http\Requests\Admin\NodeFormRequest;
|
|
|
|
use Pterodactyl\Models\Allocation;
|
|
|
|
use Pterodactyl\Models\Node;
|
2016-12-07 22:46:38 +00:00
|
|
|
use Illuminate\Http\Request;
|
2016-09-07 20:12:06 +00:00
|
|
|
use Pterodactyl\Exceptions\DisplayException;
|
2016-01-05 04:59:45 +00:00
|
|
|
use Pterodactyl\Http\Controllers\Controller;
|
2016-12-07 22:46:38 +00:00
|
|
|
use Pterodactyl\Repositories\NodeRepository;
|
|
|
|
use Pterodactyl\Exceptions\DisplayValidationException;
|
2017-08-05 22:20:07 +00:00
|
|
|
use Pterodactyl\Services\Nodes\CreationService;
|
|
|
|
use Pterodactyl\Services\Nodes\DeletionService;
|
|
|
|
use Pterodactyl\Services\Nodes\UpdateService;
|
2016-01-05 04:59:45 +00:00
|
|
|
|
|
|
|
class NodesController extends Controller
|
|
|
|
{
|
2017-08-05 22:20:07 +00:00
|
|
|
/**
|
|
|
|
* @var \Prologue\Alerts\AlertsMessageBag
|
|
|
|
*/
|
|
|
|
protected $alert;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var \Illuminate\Cache\Repository
|
|
|
|
*/
|
|
|
|
protected $cache;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var \Pterodactyl\Services\Nodes\CreationService
|
|
|
|
*/
|
|
|
|
protected $creationService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var \Pterodactyl\Services\Nodes\DeletionService
|
|
|
|
*/
|
|
|
|
protected $deletionService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var \Pterodactyl\Contracts\Repository\LocationRepositoryInterface
|
|
|
|
*/
|
|
|
|
protected $locationRepository;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var \Pterodactyl\Contracts\Repository\NodeRepositoryInterface
|
|
|
|
*/
|
|
|
|
protected $repository;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var \Illuminate\Contracts\Translation\Translator
|
|
|
|
*/
|
|
|
|
protected $translator;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var \Pterodactyl\Services\Nodes\UpdateService
|
|
|
|
*/
|
|
|
|
protected $updateService;
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
AlertsMessageBag $alert,
|
|
|
|
CacheRepository $cache,
|
|
|
|
CreationService $creationService,
|
|
|
|
DeletionService $deletionService,
|
|
|
|
LocationRepositoryInterface $locationRepository,
|
|
|
|
NodeRepositoryInterface $repository,
|
|
|
|
Translator $translator,
|
|
|
|
UpdateService $updateService
|
|
|
|
) {
|
|
|
|
$this->alert = $alert;
|
|
|
|
$this->cache = $cache;
|
|
|
|
$this->creationService = $creationService;
|
|
|
|
$this->deletionService = $deletionService;
|
|
|
|
$this->locationRepository = $locationRepository;
|
|
|
|
$this->repository = $repository;
|
|
|
|
$this->translator = $translator;
|
|
|
|
$this->updateService = $updateService;
|
|
|
|
}
|
|
|
|
|
2016-01-05 04:59:45 +00:00
|
|
|
/**
|
2017-03-04 04:37:41 +00:00
|
|
|
* Displays the index page listing all nodes on the panel.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
2017-03-04 04:37:41 +00:00
|
|
|
* @return \Illuminate\View\View
|
2016-01-05 04:59:45 +00:00
|
|
|
*/
|
2017-03-04 04:37:41 +00:00
|
|
|
public function index(Request $request)
|
2016-01-05 04:59:45 +00:00
|
|
|
{
|
2017-08-05 22:20:07 +00:00
|
|
|
return view('admin.nodes.index', [
|
|
|
|
'nodes' => $this->repository->search($request->input('query'))->getNodeListingData(),
|
|
|
|
]);
|
2016-01-05 04:59:45 +00:00
|
|
|
}
|
|
|
|
|
2017-03-04 04:37:41 +00:00
|
|
|
/**
|
|
|
|
* Displays create new node page.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
2017-03-04 04:37:41 +00:00
|
|
|
*/
|
2017-08-05 22:20:07 +00:00
|
|
|
public function create()
|
2016-01-05 04:59:45 +00:00
|
|
|
{
|
2017-08-05 22:20:07 +00:00
|
|
|
$locations = $this->locationRepository->all();
|
|
|
|
if (count($locations) < 1) {
|
|
|
|
$this->alert->warning($this->translator->trans('admin/node.notices.location_required'))->flash();
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2016-09-30 20:05:39 +00:00
|
|
|
return redirect()->route('admin.locations');
|
|
|
|
}
|
|
|
|
|
2017-03-04 04:37:41 +00:00
|
|
|
return view('admin.nodes.new', ['locations' => $locations]);
|
2016-01-05 04:59:45 +00:00
|
|
|
}
|
|
|
|
|
2017-03-04 04:37:41 +00:00
|
|
|
/**
|
|
|
|
* Post controller to create a new node on the system.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @param \Pterodactyl\Http\Requests\Admin\NodeFormRequest $request
|
2017-03-19 23:36:50 +00:00
|
|
|
* @return \Illuminate\Http\RedirectResponse
|
2017-08-05 22:20:07 +00:00
|
|
|
*
|
|
|
|
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
2017-03-04 04:37:41 +00:00
|
|
|
*/
|
2017-08-05 22:20:07 +00:00
|
|
|
public function store(NodeFormRequest $request)
|
2016-01-05 04:59:45 +00:00
|
|
|
{
|
2017-08-05 22:20:07 +00:00
|
|
|
$node = $this->creationService->handle($request->normalize());
|
|
|
|
$this->alert->info($this->translator->trans('admin/node.notices.node_created'))->flash();
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2017-08-05 22:20:07 +00:00
|
|
|
return redirect()->route('admin.nodes.view.allocation', $node->id);
|
2016-01-05 04:59:45 +00:00
|
|
|
}
|
|
|
|
|
2017-03-03 22:30:39 +00:00
|
|
|
/**
|
|
|
|
* Shows the index overview page for a specific node.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @param int $node
|
2017-03-03 22:30:39 +00:00
|
|
|
* @return \Illuminate\View\View
|
|
|
|
*/
|
2017-08-05 22:20:07 +00:00
|
|
|
public function viewIndex($node)
|
2017-03-03 22:30:39 +00:00
|
|
|
{
|
2017-08-05 22:20:07 +00:00
|
|
|
return view('admin.nodes.view.index', [
|
|
|
|
'node' => $this->repository->getSingleNode($node),
|
|
|
|
'stats' => $this->repository->getUsageStats($node),
|
|
|
|
]);
|
2017-03-03 22:30:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows the settings page for a specific node.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @param \Pterodactyl\Models\Node $node
|
2017-03-03 22:30:39 +00:00
|
|
|
* @return \Illuminate\View\View
|
|
|
|
*/
|
2017-08-05 22:20:07 +00:00
|
|
|
public function viewSettings(Node $node)
|
2017-03-03 22:30:39 +00:00
|
|
|
{
|
|
|
|
return view('admin.nodes.view.settings', [
|
2017-08-05 22:20:07 +00:00
|
|
|
'node' => $node,
|
|
|
|
'locations' => $this->locationRepository->all(),
|
2017-03-03 22:30:39 +00:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows the configuration page for a specific node.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @param \Pterodactyl\Models\Node $node
|
2017-03-03 22:30:39 +00:00
|
|
|
* @return \Illuminate\View\View
|
|
|
|
*/
|
2017-08-05 22:20:07 +00:00
|
|
|
public function viewConfiguration(Node $node)
|
2017-03-03 22:30:39 +00:00
|
|
|
{
|
2017-08-05 22:20:07 +00:00
|
|
|
return view('admin.nodes.view.configuration', ['node' => $node]);
|
2017-03-03 22:30:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows the allocation page for a specific node.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @param int $node
|
2017-03-03 22:30:39 +00:00
|
|
|
* @return \Illuminate\View\View
|
|
|
|
*/
|
2017-08-05 22:20:07 +00:00
|
|
|
public function viewAllocation($node)
|
2017-03-03 22:30:39 +00:00
|
|
|
{
|
2017-08-05 22:20:07 +00:00
|
|
|
$node = $this->repository->getNodeAllocations($node);
|
|
|
|
Javascript::put(['node' => collect($node)->only(['id'])]);
|
2017-03-03 22:30:39 +00:00
|
|
|
|
|
|
|
return view('admin.nodes.view.allocation', ['node' => $node]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows the server listing page for a specific node.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @param int $node
|
2017-03-03 22:30:39 +00:00
|
|
|
* @return \Illuminate\View\View
|
|
|
|
*/
|
2017-08-05 22:20:07 +00:00
|
|
|
public function viewServers($node)
|
2017-03-03 22:30:39 +00:00
|
|
|
{
|
2017-08-05 22:20:07 +00:00
|
|
|
$node = $this->repository->getNodeServers($node);
|
2017-03-03 22:30:39 +00:00
|
|
|
Javascript::put([
|
|
|
|
'node' => collect($node->makeVisible('daemonSecret'))->only(['scheme', 'fqdn', 'daemonListen', 'daemonSecret']),
|
|
|
|
]);
|
|
|
|
|
2017-08-05 22:20:07 +00:00
|
|
|
return view('admin.nodes.view.servers', ['node' => $node]);
|
2017-03-03 22:30:39 +00:00
|
|
|
}
|
|
|
|
|
2017-03-04 04:14:23 +00:00
|
|
|
/**
|
|
|
|
* Updates settings for a node.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @param \Pterodactyl\Http\Requests\Admin\NodeFormRequest $request
|
|
|
|
* @param \Pterodactyl\Models\Node $node
|
2017-03-04 04:14:23 +00:00
|
|
|
* @return \Illuminate\Http\RedirectResponse
|
2017-08-05 22:20:07 +00:00
|
|
|
*
|
|
|
|
* @throws \Pterodactyl\Exceptions\DisplayException
|
|
|
|
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
2017-03-04 04:14:23 +00:00
|
|
|
*/
|
2017-08-05 22:20:07 +00:00
|
|
|
public function updateSettings(NodeFormRequest $request, Node $node)
|
2016-01-05 23:31:25 +00:00
|
|
|
{
|
2017-08-05 22:20:07 +00:00
|
|
|
$this->updateService->handle($node, $request->normalize());
|
|
|
|
$this->alert->success($this->translator->trans('admin/node.notices.node_updated'))->flash();
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2017-08-05 22:20:07 +00:00
|
|
|
return redirect()->route('admin.nodes.view.settings', $node->id)->withInput();
|
2016-01-05 23:31:25 +00:00
|
|
|
}
|
|
|
|
|
2017-03-03 22:30:39 +00:00
|
|
|
/**
|
|
|
|
* Removes a single allocation from a node.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param int $node
|
|
|
|
* @param int $allocation
|
2017-03-04 04:14:23 +00:00
|
|
|
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
|
2017-03-03 22:30:39 +00:00
|
|
|
*/
|
|
|
|
public function allocationRemoveSingle(Request $request, $node, $allocation)
|
2016-01-09 01:01:18 +00:00
|
|
|
{
|
2017-08-05 22:20:07 +00:00
|
|
|
$query = Allocation::where('node_id', $node)->whereNull('server_id')->where('id', $allocation)->delete();
|
2017-03-03 22:30:39 +00:00
|
|
|
if ($query < 1) {
|
2016-01-09 01:01:18 +00:00
|
|
|
return response()->json([
|
2016-12-07 22:46:38 +00:00
|
|
|
'error' => 'Unable to find an allocation matching those details to delete.',
|
2016-01-09 01:01:18 +00:00
|
|
|
], 400);
|
|
|
|
}
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2016-01-09 01:01:18 +00:00
|
|
|
return response('', 204);
|
|
|
|
}
|
|
|
|
|
2017-03-03 22:30:39 +00:00
|
|
|
/**
|
|
|
|
* Remove all allocations for a specific IP at once on a node.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param int $node
|
2017-03-04 04:14:23 +00:00
|
|
|
* @return \Illuminate\Http\RedirectResponse
|
2017-03-03 22:30:39 +00:00
|
|
|
*/
|
|
|
|
public function allocationRemoveBlock(Request $request, $node)
|
2016-09-30 01:34:20 +00:00
|
|
|
{
|
2017-08-05 22:20:07 +00:00
|
|
|
$query = Allocation::where('node_id', $node)
|
|
|
|
->whereNull('server_id')
|
|
|
|
->where('ip', $request->input('ip'))
|
|
|
|
->delete();
|
2017-03-03 22:30:39 +00:00
|
|
|
if ($query < 1) {
|
2016-09-30 01:34:20 +00:00
|
|
|
Alert::danger('There was an error while attempting to delete allocations on that IP.')->flash();
|
2017-03-03 22:30:39 +00:00
|
|
|
} else {
|
|
|
|
Alert::success('Deleted all unallocated ports for <code>' . $request->input('ip') . '</code>.')->flash();
|
2016-09-30 01:34:20 +00:00
|
|
|
}
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2017-03-03 22:30:39 +00:00
|
|
|
return redirect()->route('admin.nodes.view.allocation', $node);
|
2016-09-30 01:34:20 +00:00
|
|
|
}
|
|
|
|
|
2017-03-03 22:30:39 +00:00
|
|
|
/**
|
|
|
|
* Sets an alias for a specific allocation on a node.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param int $node
|
2017-03-04 04:14:23 +00:00
|
|
|
* @return \Illuminate\Http\Response
|
2017-03-03 22:30:39 +00:00
|
|
|
*/
|
|
|
|
public function allocationSetAlias(Request $request, $node)
|
2016-09-30 01:34:20 +00:00
|
|
|
{
|
2017-03-03 22:30:39 +00:00
|
|
|
if (! $request->input('allocation_id')) {
|
2016-09-30 01:34:20 +00:00
|
|
|
return response('Missing required parameters.', 422);
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
2017-08-05 22:20:07 +00:00
|
|
|
$update = Allocation::findOrFail($request->input('allocation_id'));
|
2016-09-30 20:01:36 +00:00
|
|
|
$update->ip_alias = (empty($request->input('alias'))) ? null : $request->input('alias');
|
2016-09-30 01:34:20 +00:00
|
|
|
$update->save();
|
|
|
|
|
|
|
|
return response('', 204);
|
|
|
|
} catch (\Exception $ex) {
|
|
|
|
throw $ex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-03 22:30:39 +00:00
|
|
|
/**
|
|
|
|
* Creates new allocations on a node.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param int $node
|
2017-03-03 22:30:39 +00:00
|
|
|
* @return \Illuminate\Http\RedirectResponse
|
|
|
|
*/
|
|
|
|
public function createAllocation(Request $request, $node)
|
2016-01-10 05:38:16 +00:00
|
|
|
{
|
2017-03-03 22:30:39 +00:00
|
|
|
$repo = new NodeRepository;
|
2016-09-30 21:12:36 +00:00
|
|
|
|
2017-03-03 22:30:39 +00:00
|
|
|
try {
|
|
|
|
$repo->addAllocations($node, $request->intersect(['allocation_ip', 'allocation_alias', 'allocation_ports']));
|
|
|
|
Alert::success('Successfully added new allocations!')->flash();
|
|
|
|
} catch (DisplayValidationException $ex) {
|
2017-08-05 22:20:07 +00:00
|
|
|
return redirect()
|
|
|
|
->route('admin.nodes.view.allocation', $node)
|
|
|
|
->withErrors(json_decode($ex->getMessage()))
|
|
|
|
->withInput();
|
2017-03-03 22:30:39 +00:00
|
|
|
} catch (DisplayException $ex) {
|
|
|
|
Alert::danger($ex->getMessage())->flash();
|
|
|
|
} catch (\Exception $ex) {
|
|
|
|
Log::error($ex);
|
2017-08-05 22:20:07 +00:00
|
|
|
Alert::danger('An unhandled exception occured while attempting to add allocations this node. This error has been logged.')
|
|
|
|
->flash();
|
2016-09-30 21:12:36 +00:00
|
|
|
}
|
|
|
|
|
2017-03-03 22:30:39 +00:00
|
|
|
return redirect()->route('admin.nodes.view.allocation', $node);
|
|
|
|
}
|
2016-01-10 05:38:16 +00:00
|
|
|
|
2017-03-04 04:14:23 +00:00
|
|
|
/**
|
|
|
|
* Deletes a node from the system.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @param $node
|
2017-03-04 04:14:23 +00:00
|
|
|
* @return \Illuminate\Http\RedirectResponse
|
2017-08-05 22:20:07 +00:00
|
|
|
*
|
|
|
|
* @throws \Pterodactyl\Exceptions\DisplayException
|
2017-03-04 04:14:23 +00:00
|
|
|
*/
|
2017-08-05 22:20:07 +00:00
|
|
|
public function delete($node)
|
2017-03-03 22:30:39 +00:00
|
|
|
{
|
2017-08-05 22:20:07 +00:00
|
|
|
$this->deletionService->handle($node);
|
|
|
|
$this->alert->success($this->translator->trans('admin/node.notices.node_deleted'))->flash();
|
2016-12-07 22:46:38 +00:00
|
|
|
|
2017-08-05 22:20:07 +00:00
|
|
|
return redirect()->route('admin.nodes');
|
2016-01-10 21:59:19 +00:00
|
|
|
}
|
2017-01-07 17:10:11 +00:00
|
|
|
|
2017-03-04 04:14:23 +00:00
|
|
|
/**
|
|
|
|
* Returns the configuration token to auto-deploy a node.
|
|
|
|
*
|
2017-08-05 22:20:07 +00:00
|
|
|
* @param \Pterodactyl\Models\Node $node
|
2017-03-04 04:14:23 +00:00
|
|
|
* @return \Illuminate\Http\JsonResponse
|
|
|
|
*/
|
2017-08-05 22:20:07 +00:00
|
|
|
public function setToken(Node $node)
|
2017-01-07 17:39:41 +00:00
|
|
|
{
|
2017-08-05 22:20:07 +00:00
|
|
|
$token = bin2hex(random_bytes(16));
|
|
|
|
$this->cache->tags(['Node:Configuration'])->put($token, $node->id, 5);
|
2017-03-04 04:14:23 +00:00
|
|
|
|
2017-05-01 18:21:18 +00:00
|
|
|
return response()->json(['token' => $token]);
|
2017-01-07 17:10:11 +00:00
|
|
|
}
|
2016-01-05 04:59:45 +00:00
|
|
|
}
|