You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- namespace App\Http\Controllers\Web\LoginUser;
-
- use App\Codes\UserRole;
- use App\Http\Controllers\Web\WebController;
- use App\Logics\LoginUser\LoginUserLogic;
- use App\Models\User;
- use Illuminate\Http\JsonResponse;
- use Illuminate\Http\Request;
-
- class ShopDeleteController extends WebController
- {
-
- public function name(): string
- {
- return "店舗ログインユーザ削除";
- }
-
- public function description(): string
- {
- return "店舗ログインユーザを削除する";
- }
-
-
- public function __construct(protected ShopDeleteParam $param, protected LoginUserLogic $logic)
- {
- parent::__construct();
- }
-
- protected function run(Request $request): JsonResponse
- {
- $user = User::whereId($this->param->userId)
- ->whereRole(UserRole::SHOP)
- ->whereCustomerCode($this->sessionUser->customerCode())
- ->firstOrFail();
-
- $this->logic->delete($user);
-
- return $this->successResponse();
- }
- }
|