wip
This commit is contained in:
@@ -6,12 +6,14 @@ use App\Models\Branch\Branch;
|
||||
use App\Models\Order\Card\CardOrder as CardOrderModel;
|
||||
use App\Nova\Filters\RegionFilter;
|
||||
use App\Nova\Filters\StatusFilter;
|
||||
use App\Nova\Forms\NovaForm;
|
||||
use App\Nova\Resource;
|
||||
use App\Nova\Resources\Order\Card\Concerns\CardOrderFieldsForDetail;
|
||||
use App\Nova\Resources\Order\Card\Concerns\CardOrderFieldsForIndex;
|
||||
use App\Repos\Order\Card\CardStateRepo;
|
||||
use App\Repos\Order\Card\CardTypeRepo;
|
||||
use App\Repos\Order\OrderRepo;
|
||||
use App\Repos\Payment\OnlinePaymentRepo;
|
||||
use App\Repos\System\Location\CountryRepo;
|
||||
use App\Repos\System\Nova\NovaRepo;
|
||||
use App\Repos\System\Settings\Legal\PassportRepo;
|
||||
@@ -20,7 +22,6 @@ use App\Rules\DowranAgaAllowed;
|
||||
use App\Rules\OnlyLetters;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Laravel\Nova\Fields\Boolean;
|
||||
use Laravel\Nova\Fields\Date;
|
||||
use Laravel\Nova\Fields\Hidden;
|
||||
use Laravel\Nova\Fields\ID;
|
||||
@@ -30,6 +31,7 @@ use Laravel\Nova\Fields\Select;
|
||||
use Laravel\Nova\Fields\Text;
|
||||
use Laravel\Nova\Http\Requests\NovaRequest;
|
||||
use Laravel\Nova\Panel;
|
||||
use Laravel\Nova\URL;
|
||||
use Nurmuhammet\NovaCustomHtml\NovaCustomHtml;
|
||||
use Nurmuhammet\NovaInputmask\NovaInputmask;
|
||||
|
||||
@@ -123,6 +125,30 @@ class CardOrder extends Resource
|
||||
return $query->where('user_id', $request->user()->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the location to redirect the user after creation.
|
||||
*
|
||||
* @param \Laravel\Nova\Resource $resource
|
||||
*/
|
||||
public static function redirectAfterCreate(NovaRequest $request, $resource): URL|string
|
||||
{
|
||||
return URL::remote((new OnlinePaymentRepo())->payCardOrder($resource));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the location to redirect the user after update.
|
||||
*
|
||||
* @param \Laravel\Nova\Resource $resource
|
||||
* @return \Laravel\Nova\URL|string
|
||||
*/
|
||||
public static function redirectAfterUpdate(NovaRequest $request, $resource)
|
||||
{
|
||||
return URL::remote(
|
||||
(new OnlinePaymentRepo())
|
||||
->payCardOrder($resource),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fields for index.
|
||||
*/
|
||||
@@ -306,11 +332,11 @@ class CardOrder extends Resource
|
||||
->rules('max:2048', 'mimes:jpg,png,jpeg')
|
||||
->creationRules('required')
|
||||
->updateRules('nullable'),
|
||||
|
||||
NovaCustomHtml::make(__('Data'), 'ada')
|
||||
->html(view('orders.cards.contract-agreement')->render()),
|
||||
]),
|
||||
|
||||
NovaCustomHtml::make(__('Data'), 'ada')
|
||||
->html(view('orders.cards.contract-agreement')->render())
|
||||
->fillUsing(NovaForm::fillEmpty()),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -152,18 +152,65 @@ class LoanOrder extends Resource
|
||||
->default(auth()->id())
|
||||
->hideWhenUpdating(),
|
||||
|
||||
Select::make(__('Status'), 'status')
|
||||
->displayUsingLabels()
|
||||
->searchable()
|
||||
->options(OrderRepo::statusValues())
|
||||
->default(OrderRepo::defaultStatus())
|
||||
->fullWidth()
|
||||
->rules('required')
|
||||
->canSeeWhen('systemUser', $this),
|
||||
new Panel(__('New :resource', ['resource' => $this->singularLabel()]), [
|
||||
Select::make(__('Status'), 'status')
|
||||
->displayUsingLabels()
|
||||
->searchable()
|
||||
->options(OrderRepo::statusValues())
|
||||
->default(OrderRepo::defaultStatus())
|
||||
->fullWidth()
|
||||
->rules('required')
|
||||
->canSeeWhen('systemUser', $this),
|
||||
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
Text::make(__('Note'), 'notes')
|
||||
->fullWidth()
|
||||
->canSeeWhen('systemUser', $this),
|
||||
]),
|
||||
|
||||
new Panel(__('Loan'), [
|
||||
Select::make(__('Loan type'), 'loan_type')
|
||||
|
||||
Reference in New Issue
Block a user