You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JsonResource has to be JsonResponse in generated files with the pattern [ModelName]DestroyController.php
Therefor JsonResource should be JsonResponse in file ./stubs/controller.destroy.stub
WRONG (current version):
<?php
declare(strict_types=1);
namespace {{ namespace }};
use App\Enums\Version;
use {{ namespacedModel }};
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Illuminate\Routing\Controller;
use Symfony\Component\HttpFoundation\Response;
final class {{ class }} extends Controller
{
public function __invoke(Request $request, Version $version, {{ model }} ${{ modelVariable }}): JsonResource
{
// abort_unless(
// $version->greaterThanOrEqualsTo(Version::v1_0),
// Response::HTTP_NOT_FOUND
// );
{{ model }}->delete();
return response()->json([], Response::HTTP_NO_CONTENT);
}
}
WRIGHT:
<?php
declare(strict_types=1);
namespace {{ namespace }};
use App\Enums\Version;
use {{ namespacedModel }};
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Illuminate\Routing\Controller;
use Symfony\Component\HttpFoundation\Response;
final class {{ class }} extends Controller
{
public function __invoke(Request $request, Version $version, {{ model }} ${{ modelVariable }}): JsonResponse
{
// abort_unless(
// $version->greaterThanOrEqualsTo(Version::v1_0),
// Response::HTTP_NOT_FOUND
// );
{{ model }}->delete();
return response()->json([], Response::HTTP_NO_CONTENT);
}
}
The text was updated successfully, but these errors were encountered:
JsonResource has to be JsonResponse in generated files with the pattern [ModelName]DestroyController.php
Therefor JsonResource should be JsonResponse in file ./stubs/controller.destroy.stub
WRONG (current version):
WRIGHT:
The text was updated successfully, but these errors were encountered: