phpstan 5 errors fixed
This commit is contained in:
@@ -14,6 +14,28 @@ use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
use Spatie\MediaLibrary\MediaCollections\Models\Media;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $unique_id
|
||||
* @property string $type
|
||||
* @property string $passport_name
|
||||
* @property string $passport_surname
|
||||
* @property string $phone
|
||||
* @property string $email
|
||||
* @property string $region
|
||||
* @property int $branch_id
|
||||
* @property int $user_id
|
||||
* @property string $address
|
||||
* @property array $sender_datas
|
||||
* @property array $payment_reciever
|
||||
* @property string $documents
|
||||
* @property string $status
|
||||
* @property string $notes
|
||||
* @property \Illuminate\Support\Carbon $created_at
|
||||
* @property \Illuminate\Support\Carbon $updated_at
|
||||
* @property bool $paid
|
||||
* @property \Illuminate\Support\Carbon $deleted_at
|
||||
*/
|
||||
class VisaMasterPaymentOrder extends Model implements HasMedia
|
||||
{
|
||||
use InteractsWithMedia;
|
||||
|
||||
@@ -7,6 +7,19 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $visa_master_payment_order_id
|
||||
* @property int $online_payment_history_id
|
||||
* @property ?string $payer_name
|
||||
* @property ?string $payer_card
|
||||
* @property ?string $payment_order_number
|
||||
* @property string $tmt_payment_amount
|
||||
* @property string $usd_payment_amount
|
||||
* @property bool $paid
|
||||
* @property \Illuminate\Support\Carbon $created_at
|
||||
* @property \Illuminate\Support\Carbon $updated_at
|
||||
*/
|
||||
class VisaMasterPaymentOrderItem extends Model implements HasMedia
|
||||
{
|
||||
use InteractsWithMedia;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Modules\VisaMasterPaymentOrder\Nova\Resources\Concerns;
|
||||
|
||||
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder;
|
||||
use Illuminate\Auth\Access\AuthorizationException;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -16,7 +17,10 @@ trait VisaMasterAuth
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->resource->user_id == auth()->id()) {
|
||||
/** @var VisaMasterPaymentOrder $resource */
|
||||
$resource = $this->resource;
|
||||
|
||||
if ($resource->user_id == auth()->id()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -44,7 +48,10 @@ trait VisaMasterAuth
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->resource->user_id == auth()->id()) {
|
||||
/** @var VisaMasterPaymentOrder $resource */
|
||||
$resource = $this->resource;
|
||||
|
||||
if ($resource->user_id == auth()->id()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Modules\VisaMasterPaymentOrder\Nova\Resources;
|
||||
|
||||
use App\Models\Branch\Branch;
|
||||
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder;
|
||||
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder as VisaMasterPaymentOrderModel;
|
||||
use App\Modules\VisaMasterPaymentOrder\Nova\Resources\Concerns\VisaMasterAuth;
|
||||
use App\Modules\VisaMasterPaymentOrder\Nova\Resources\Concerns\VisaMasterPaymentOrderFieldsForDetail;
|
||||
use App\Modules\VisaMasterPaymentOrder\Nova\Resources\Concerns\VisaMasterPaymentOrderFieldsForIndex;
|
||||
@@ -358,7 +359,10 @@ class NovaVisaMasterPaymentOrder extends Resource
|
||||
->icon('credit-card')
|
||||
->sole()
|
||||
->canSee(function ($request) {
|
||||
if (in_array($this->resource->status, [
|
||||
/** @var VisaMasterPaymentOrderModel $order */
|
||||
$order = $this->resource;
|
||||
|
||||
if (in_array($order->status, [
|
||||
OrderRepo::PENDING,
|
||||
OrderRepo::CANCELLED,
|
||||
])) {
|
||||
|
||||
@@ -4,11 +4,12 @@ namespace App\Modules\VisaMasterPaymentOrder\Nova\Resources;
|
||||
|
||||
use App\Models\Branch\Branch;
|
||||
use App\Models\Payment\OnlinePaymentHistory;
|
||||
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrderItem as VisaMasterPaymentOrderItemModel;
|
||||
use App\Modules\VisaMasterPaymentOrder\Nova\Resources\Item\NovaVisaMasterPaymentOrderItemAuth;
|
||||
use App\Nova\Actions\CheckOnlinePayment;
|
||||
use App\Nova\Resource;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Laravel\Nova\Actions\Action;
|
||||
use Laravel\Nova\Actions\ActionResponse;
|
||||
@@ -19,7 +20,7 @@ use Laravel\Nova\Fields\Text;
|
||||
use Laravel\Nova\Http\Requests\NovaRequest;
|
||||
|
||||
/**
|
||||
* @template TModel of \App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder
|
||||
* @template TModel of \App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrderItem
|
||||
*/
|
||||
class NovaVisaMasterPaymentOrderItem extends Resource
|
||||
{
|
||||
@@ -28,7 +29,7 @@ class NovaVisaMasterPaymentOrderItem extends Resource
|
||||
/**
|
||||
* The model the resource corresponds to.
|
||||
*
|
||||
* @var class-string<\App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder>
|
||||
* @var class-string<\App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrderItem>
|
||||
*/
|
||||
public static $model = \App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrderItem::class;
|
||||
|
||||
@@ -107,16 +108,16 @@ class NovaVisaMasterPaymentOrderItem extends Resource
|
||||
|
||||
Text::make('Amaly geçiren raýatyň kart belgisi (mask)', 'payer_card'),
|
||||
|
||||
Text::make('Töleg ýyly', fn () => $this->created_at->format('Y')),
|
||||
Text::make('Töleg aýy', fn () => $this->created_at->translatedFormat('F')),
|
||||
Text::make('Töleg ýyly', fn ($model) => $model->format('Y')),
|
||||
Text::make('Töleg aýy', fn ($model) => $model->created_at->translatedFormat('F')),
|
||||
|
||||
Text::make('Amalyň geçirilen wagty', fn () => $this->created_at->format('H:i, d.m.Y')),
|
||||
Text::make('Amalyň geçirilen wagty', fn ($model) => $model->created_at->format('H:i, d.m.Y')),
|
||||
|
||||
Text::make('Amalyň möçberi', fn () => $this->usd_payment_amount.' USD'),
|
||||
Text::make('Amalyň möçberi', fn ($model) => $model->usd_payment_amount.' USD'),
|
||||
|
||||
Text::make('Amalyň manat möçberi', fn () => $this->tmt_payment_amount.' TMT'),
|
||||
Text::make('Amalyň manat möçberi', fn ($model) => $model->tmt_payment_amount.' TMT'),
|
||||
|
||||
Text::make('Amalyň referensi', fn () => $this->payment_order_number),
|
||||
Text::make('Amalyň referensi', fn ($model) => $model->payment_order_number),
|
||||
|
||||
Boolean::make(__('Paid'), 'paid'),
|
||||
];
|
||||
@@ -126,7 +127,8 @@ class NovaVisaMasterPaymentOrderItem extends Resource
|
||||
{
|
||||
return [
|
||||
Action::using('HALKBANK töleg barla', function (ActionFields $fields, Collection $models) {
|
||||
$item = $onlinePaymentResource = $models->first();
|
||||
/** @var VisaMasterPaymentOrderItemModel $item */
|
||||
$item = $models->first();
|
||||
|
||||
$onlinePaymentResource = OnlinePaymentHistory::find($item->online_payment_history_id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user