Very rough go at getting API back into operational state.
Not spending a lot of time on this as its a pre-release and I have plans to overhaul the API to actually work and be easy to maintain.
This commit is contained in:
parent
4e916cbf08
commit
5e27772fef
7 changed files with 189 additions and 333 deletions
|
@ -24,31 +24,20 @@
|
|||
|
||||
namespace Pterodactyl\Http\Controllers\API;
|
||||
|
||||
use Pterodactyl\Models;
|
||||
use Illuminate\Http\Request;
|
||||
use Pterodactyl\Models\Service;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* @Resource("Services")
|
||||
*/
|
||||
class ServiceController extends BaseController
|
||||
{
|
||||
public function __construct()
|
||||
public function index(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function lists(Request $request)
|
||||
{
|
||||
return Models\Service::all()->toArray();
|
||||
return Service::all()->toArray();
|
||||
}
|
||||
|
||||
public function view(Request $request, $id)
|
||||
{
|
||||
$service = Models\Service::with('options.variables', 'options.packs')->find($id);
|
||||
if (! $service) {
|
||||
throw new NotFoundHttpException('No service by that ID was found.');
|
||||
}
|
||||
$service = Service::with('options.variables', 'options.packs')->findOrFail($id);
|
||||
|
||||
return $service->toArray();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue