-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3c2281
commit 2e89222
Showing
44 changed files
with
1,964 additions
and
409 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
{ | ||
"editor.rulers": [ | ||
100 | ||
], | ||
"[php]": { | ||
"editor.defaultFormatter": "open-southeners.laravel-pint" | ||
}, | ||
"intelephense.codeLens.implementations.enable": true, | ||
"intelephense.codeLens.overrides.enable": true, | ||
"intelephense.codeLens.parent.enable": true, | ||
"intelephense.codeLens.references.enable": true, | ||
"intelephense.codeLens.usages.enable": true, | ||
"intelephense.format.enable": false, | ||
"editor.formatOnSave": true, | ||
"laravel-pint.enable": true, | ||
"phpstan.showTypeOnHover": true | ||
"editor.rulers": [ | ||
100 | ||
], | ||
"[php]": { | ||
"editor.defaultFormatter": "open-southeners.laravel-pint" | ||
}, | ||
"intelephense.codeLens.implementations.enable": true, | ||
"intelephense.codeLens.overrides.enable": true, | ||
"intelephense.codeLens.parent.enable": true, | ||
"intelephense.codeLens.references.enable": true, | ||
"intelephense.codeLens.usages.enable": true, | ||
"intelephense.format.enable": false, | ||
"editor.formatOnSave": true, | ||
"laravel-pint.enable": true, | ||
"phpstan.showTypeOnHover": true, | ||
"helper.models": false, | ||
"intelephense.files.maxSize": 5000000, | ||
"intelephense.telemetry.enabled": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Api; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Http\Requests\GameBuildSettingCreateRequest; | ||
use App\Http\Requests\GameBuildSettingUpdateRequest; | ||
use App\Http\Requests\IndexQueryRequest; | ||
use App\Http\Resources\GameBuildSettingResource; | ||
use App\Models\GameBuildSetting; | ||
use App\Rules\DateRange; | ||
use App\Traits\IndexableQuery; | ||
use App\Traits\ManagesGameBuildSettings; | ||
use Illuminate\Http\Resources\Json\AnonymousResourceCollection; | ||
use Illuminate\Pagination\LengthAwarePaginator; | ||
|
||
/** | ||
* @tags Game Build Settings | ||
*/ | ||
class GameBuildSettingsController extends Controller | ||
{ | ||
use IndexableQuery, ManagesGameBuildSettings; | ||
|
||
/** | ||
* List | ||
* | ||
* List paginated and filtered game build settings | ||
* | ||
* @return AnonymousResourceCollection<LengthAwarePaginator<GameBuildSettingResource>> | ||
*/ | ||
public function index(IndexQueryRequest $request) | ||
{ | ||
$request->validate([ | ||
'filters.id' => 'int', | ||
'filters.server' => 'string', | ||
'filters.branch' => 'string', | ||
'filters.byond_major' => 'int', | ||
'filters.byond_minor' => 'int', | ||
'filters.rustg_version' => 'string', | ||
'filters.rp_mode' => 'boolean', | ||
'filters.map_id' => 'string', | ||
/** | ||
* A date or date range | ||
* | ||
* @example 2023/01/30 12:00:00 - 2023/02/01 12:00:00 | ||
*/ | ||
'filters.created_at' => new DateRange, | ||
/** | ||
* A date or date range | ||
* | ||
* @example 2023/01/30 12:00:00 - 2023/02/01 12:00:00 | ||
*/ | ||
'filters.updated_at' => new DateRange, | ||
]); | ||
|
||
return GameBuildSettingResource::collection( | ||
$this->indexQuery(GameBuildSetting::class) | ||
); | ||
} | ||
|
||
/** | ||
* Add | ||
* | ||
* Add a new game build setting | ||
*/ | ||
public function store(GameBuildSettingCreateRequest $request) | ||
{ | ||
return $this->addSetting($request); | ||
} | ||
|
||
/** | ||
* Update | ||
* | ||
* Update an existing game build setting | ||
*/ | ||
public function update(GameBuildSettingUpdateRequest $request, GameBuildSetting $setting) | ||
{ | ||
return $this->updateSetting($request, $setting); | ||
} | ||
|
||
/** | ||
* Delete | ||
* | ||
* Delete an existing game build setting | ||
*/ | ||
public function destroy(GameBuildSetting $setting) | ||
{ | ||
$setting->delete(); | ||
|
||
return ['message' => 'Setting removed']; | ||
} | ||
} |
Oops, something went wrong.