cleanup
This commit is contained in:
parent
1f8b34e684
commit
01b5ec80a6
|
@ -57,6 +57,7 @@ class NotificationController extends Controller
|
|||
*
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws ValidationException
|
||||
*/
|
||||
public function send(Request $request)
|
||||
{
|
||||
|
@ -90,8 +91,8 @@ class NotificationController extends Controller
|
|||
$userIds = explode(",", $data["users"]);
|
||||
$users = User::query()
|
||||
->whereIn("id", $userIds)
|
||||
->orWhereHas('discordUser' , function (Builder $builder) use ($userIds) {
|
||||
$builder->whereIn('id' , $userIds);
|
||||
->orWhereHas('discordUser', function (Builder $builder) use ($userIds) {
|
||||
$builder->whereIn('id', $userIds);
|
||||
})
|
||||
->get();
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ use Spatie\QueryBuilder\QueryBuilder;
|
|||
class ServerController extends Controller
|
||||
{
|
||||
const ALLOWED_INCLUDES = ['product', 'user'];
|
||||
const ALLOWED_FILTERS = ['name', 'suspended', 'identifier', 'pterodactyl_id', 'user_id' , 'product_id'];
|
||||
const ALLOWED_FILTERS = ['name', 'suspended', 'identifier', 'pterodactyl_id', 'user_id', 'product_id'];
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
|
@ -31,9 +31,6 @@ class ServerController extends Controller
|
|||
return $query->paginate($request->input('per_page') ?? 50);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
|
@ -43,13 +40,12 @@ class ServerController extends Controller
|
|||
public function show(Server $server)
|
||||
{
|
||||
$query = QueryBuilder::for(Server::class)
|
||||
->where('id' ,'=' , $server->id)
|
||||
->where('id', '=', $server->id)
|
||||
->allowedIncludes(self::ALLOWED_INCLUDES);
|
||||
|
||||
return $query->get();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
|
|
|
@ -13,7 +13,6 @@ use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
|||
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Http\Client\RequestException;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\App;
|
||||
|
@ -166,7 +165,7 @@ class UserController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* @throws RequestException
|
||||
* @throws ValidationException
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Server;
|
||||
use App\Models\Voucher;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
@ -69,7 +68,7 @@ class VoucherController extends Controller
|
|||
public function show(int $id)
|
||||
{
|
||||
$query = QueryBuilder::for(Voucher::class)
|
||||
->where('id' ,'=' , $id)
|
||||
->where('id', '=', $id)
|
||||
->allowedIncludes(self::ALLOWED_INCLUDES);
|
||||
|
||||
return $query->get();
|
||||
|
|
Loading…
Reference in a new issue