Skip to content

Commit

Permalink
feat: update update request
Browse files Browse the repository at this point in the history
  • Loading branch information
halivert committed Jul 28, 2023
1 parent 0c5fc65 commit 32ffcf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions app/API/CreditCard/v1/CreditCardController.php
Expand Up @@ -4,13 +4,12 @@

use App\API\CreditCard\CreditCard;
use App\Http\Controllers\Controller;
use App\Models\User;

class CreditCardController extends Controller
{
public function __construct()
{
$this->authorizeResource(CreditCard::class);
$this->authorizeResource(CreditCard::class, 'creditCard');
}

/**
Expand Down
6 changes: 3 additions & 3 deletions app/API/CreditCard/v1/UpdateCreditCardRequest.php
Expand Up @@ -11,7 +11,7 @@ class UpdateCreditCardRequest extends FormRequest
*/
public function authorize(): bool
{
return $this->user()->can('update', $this->credit_card);
return $this->user()->can('update', $this->creditCard);
}

/**
Expand All @@ -25,8 +25,8 @@ public function rules(): array
'name' => 'sometimes|required|string|max:255',
'due_date' => 'sometimes|required|integer|min:1|max:28',
'closing_date' => 'sometimes|required|integer|min:1|max:28',
'interest_rate' => 'sometimes|nullable|decimal:2|min:0|max:100',
'limit' => 'sometimes|required|decimal:2,4|min:0',
'interest_rate' => 'sometimes|nullable|decimal:0,2|min:0|max:200',
'limit' => 'sometimes|required|decimal:0,4|min:0',
];
}

Expand Down

0 comments on commit 32ffcf7

Please sign in to comment.