wip
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Modules\DateHelper\Repositories\DateHelperRepository;
|
|||||||
use App\Nova\Resources\Order\Card\CardBalance\Actions\DownloadCardBalance;
|
use App\Nova\Resources\Order\Card\CardBalance\Actions\DownloadCardBalance;
|
||||||
use App\Repos\System\Settings\Legal\PassportRepo;
|
use App\Repos\System\Settings\Legal\PassportRepo;
|
||||||
use Dedoc\Scramble\Attributes\Group;
|
use Dedoc\Scramble\Attributes\Group;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
@@ -114,62 +115,62 @@ class CardBalanceController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * UPDATE*
|
* UPDATE*
|
||||||
// *
|
*
|
||||||
// * ID ugradyp `route`-da update edip bilyan. Base App Enum-lardan peydalan. Panelkadan gor.
|
* ID ugradyp `route`-da update edip bilyan. Base App Enum-lardan peydalan. Panelkadan gor.
|
||||||
// */
|
*/
|
||||||
// public function update(Request $request, CardTransaction $order): JsonResponse
|
public function update(Request $request, CardBalance $order): JsonResponse
|
||||||
// {
|
{
|
||||||
// $data = $request->validate([
|
$data = $request->validate([
|
||||||
// /**
|
/**
|
||||||
// * @example I-AS
|
* @example I-AS
|
||||||
// */
|
*/
|
||||||
// 'passport_serie' => ['sometimes', Rule::in(array_keys(PassportRepo::values()))],
|
'passport_serie' => ['sometimes', Rule::in(array_keys(PassportRepo::values()))],
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @example 379514
|
* @example 379514
|
||||||
// */
|
*/
|
||||||
// 'passport_id' => ['sometimes', 'numeric', 'digits:6'],
|
'passport_id' => ['sometimes', 'numeric', 'digits:6'],
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @example 9934612100000243
|
* @example 9934612100000243
|
||||||
// */
|
*/
|
||||||
// 'card_number' => ['sometimes', 'digits:16'],
|
'card_number' => ['sometimes', 'digits:16'],
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @example 12
|
* @example 12
|
||||||
// */
|
*/
|
||||||
// 'card_month' => ['sometimes', Rule::in(array_keys(DateHelperRepository::staticNumberMonths()))],
|
'card_month' => ['sometimes', Rule::in(array_keys(DateHelperRepository::staticNumberMonths()))],
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @example 2049
|
* @example 2049
|
||||||
// */
|
*/
|
||||||
// 'card_year' => ['sometimes', Rule::in(array_keys(DateHelperRepository::staticNumberYears()))],
|
'card_year' => ['sometimes', Rule::in(array_keys(DateHelperRepository::staticNumberYears()))],
|
||||||
// ]);
|
]);
|
||||||
|
|
||||||
// Model::unguarded(function () use ($order, $data) {
|
Model::unguarded(function () use ($order, $data) {
|
||||||
// $order->update($data);
|
$order->update($data);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// return response()->json([
|
return response()->json([
|
||||||
// 'message' => __('Successfully updated'),
|
'message' => __('Successfully updated'),
|
||||||
// ]);
|
]);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * DELETE*
|
* DELETE*
|
||||||
// */
|
*/
|
||||||
// public function destroy(CardTransaction $order): JsonResponse
|
public function destroy(CardBalance $order): JsonResponse
|
||||||
// {
|
{
|
||||||
// if ($order->user_id != auth()->id()) {
|
if ($order->user_id != auth()->id()) {
|
||||||
// return response()->json(status: 403);
|
return response()->json(status: 403);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// $order->delete();
|
$order->delete();
|
||||||
|
|
||||||
// return response()->json([
|
return response()->json([
|
||||||
// 'message' => __('Successfully deleted'),
|
'message' => __('Successfully deleted'),
|
||||||
// ]);
|
]);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user