2021-01-05 21:52:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Requests\Api\Application\Databases;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\DatabaseHost;
|
|
|
|
|
|
|
|
class GetDatabaseRequest extends GetDatabasesRequest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Determine if the requested database exists on the Panel.
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function resourceExists(): bool
|
|
|
|
{
|
2021-01-09 16:38:50 +00:00
|
|
|
$databaseHost = $this->route()->parameter('databaseHost');
|
2021-01-05 21:52:49 +00:00
|
|
|
|
2021-01-09 16:38:50 +00:00
|
|
|
return $databaseHost instanceof DatabaseHost && $databaseHost->exists;
|
2021-01-05 21:52:49 +00:00
|
|
|
}
|
|
|
|
}
|