wip
This commit is contained in:
@@ -10,8 +10,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @property string unique_id
|
||||
* @property string $unique_id
|
||||
* @property int $user_id
|
||||
* @property int $card_type_id
|
||||
* @property string $card_number
|
||||
@@ -20,18 +19,18 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
* @property string $customer_name
|
||||
* @property string $customer_surname
|
||||
* @property string $customer_patronic_name
|
||||
* @property date $born_at
|
||||
* @property \Illuminate\Support\Carbon $born_at
|
||||
* @property string $phone
|
||||
* @property string $passport_serie
|
||||
* @property string $passport_id
|
||||
* @property text $passport_one
|
||||
* @property text $passport_two
|
||||
* @property text $passport_three
|
||||
* @property text $passport_four
|
||||
* @property string $passport_one
|
||||
* @property string $passport_two
|
||||
* @property string $passport_three
|
||||
* @property string $passport_four
|
||||
* @property string $status
|
||||
* @property null|string $notes
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
*/
|
||||
class CardPinOrder extends Model
|
||||
{
|
||||
|
||||
@@ -8,6 +8,8 @@ class DefaultQueryForResourceIndexRepository
|
||||
{
|
||||
/**
|
||||
* Default filament table query builder
|
||||
*
|
||||
* @param Builder<\Illuminate\Database\Eloquent\Model> $query
|
||||
*/
|
||||
public static function make(Builder $query): void
|
||||
{
|
||||
|
||||
@@ -4,13 +4,17 @@ namespace App\Modules\Loan\Repositories;
|
||||
|
||||
use App\Modules\Loan\Models\Loan;
|
||||
use App\Modules\Makeable;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class LoanRepository
|
||||
{
|
||||
use Makeable;
|
||||
|
||||
public function showRemainingLoan(Loan $record)
|
||||
/**
|
||||
* Show remaining loan
|
||||
*/
|
||||
public function showRemainingLoan(Loan $record): View
|
||||
{
|
||||
$data = $this->fetchCardBalance(
|
||||
passport_serie: user()->passport_serie(),
|
||||
@@ -21,6 +25,9 @@ class LoanRepository
|
||||
return view('module.loan::loan-remaining', compact('data'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch card card balance from abs
|
||||
*/
|
||||
public function fetchCardBalance(string $passport_serie, int|string $passport_id, int|string $account_number): object
|
||||
{
|
||||
$curl = curl_init();
|
||||
|
||||
@@ -57,6 +57,6 @@ trait RoleCheckers
|
||||
*/
|
||||
public function isSystemUser(): bool
|
||||
{
|
||||
return $this->roles->count > 0;
|
||||
return $this->roles->count() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Modules\UserAdjustments\Traits;
|
||||
|
||||
use App\Modules\Branch\Models\Branch;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
/**
|
||||
@@ -61,4 +63,14 @@ trait UserAdjustments
|
||||
{
|
||||
return (string) $this->getOption('passport_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Branches associated with user
|
||||
*
|
||||
* @return BelongsToMany<Branch>
|
||||
*/
|
||||
public function branches(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Branch::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user