Skip to content

Commit

Permalink
eloquent repo model loading issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
hafijul233 committed May 10, 2024
1 parent f72bd90 commit 8430622
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 26 deletions.
10 changes: 5 additions & 5 deletions src/Http/Controllers/WalletTransferController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ class WalletTransferController extends Controller
*/
public function index(IndexWalletTransferRequest $request): WalletTransferCollection|JsonResponse
{
try {
// try {
$inputs = $request->validated();
$inputs['transaction_form_id'] = Transaction::transactionForm()->list(['code' => 'wallet_transfer'])->first()->getKey();
$walletTransferPaginate = Remit::walletTransfer()->list($inputs);

return new WalletTransferCollection($walletTransferPaginate);

} catch (Exception $exception) {

return response()->failed($exception->getMessage());
}
// } catch (Exception $exception) {
//
// return response()->failed($exception->getMessage());
// }
}

/**
Expand Down
8 changes: 1 addition & 7 deletions src/Repositories/Eloquent/BankTransferRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ class BankTransferRepository extends OrderRepository implements InterfacesBankTr
{
public function __construct()
{
$model = app(config('fintech.remit.bank_transfer_model', BankTransfer::class));

if (! $model instanceof Model) {
throw new InvalidArgumentException("Eloquent repository require model class to be `Illuminate\Database\Eloquent\Model` instance.");
}

$this->model = $model;
parent::__construct(config('fintech.remit.bank_transfer_model', BankTransfer::class));
}

/**
Expand Down
8 changes: 1 addition & 7 deletions src/Repositories/Eloquent/CashPickupRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@ class CashPickupRepository extends OrderRepository implements InterfacesCashPick
{
public function __construct()
{
$model = app(config('fintech.remit.cash_pickup_model', CashPickup::class));

if (! $model instanceof Model) {
throw new InvalidArgumentException("Eloquent repository require model class to be `Illuminate\Database\Eloquent\Model` instance.");
}

$this->model = $model;
parent::__construct(config('fintech.remit.cash_pickup_model', CashPickup::class));
}

/**
Expand Down
8 changes: 1 addition & 7 deletions src/Repositories/Eloquent/WalletTransferRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@ class WalletTransferRepository extends OrderRepository implements InterfacesWall
{
public function __construct()
{
$model = app(config('fintech.remit.wallet_transfer_model', WalletTransfer::class));

if (! $model instanceof Model) {
throw new InvalidArgumentException("Eloquent repository require model class to be `Illuminate\Database\Eloquent\Model` instance.");
}

$this->model = $model;
parent::__construct(config('fintech.remit.wallet_transfer_model', WalletTransfer::class));
}

/**
Expand Down

0 comments on commit 8430622

Please sign in to comment.