wip
This commit is contained in:
@@ -13,6 +13,7 @@ use App\Nova\Resources\Order\Card\Requisite\Concerns\CardRequisiteFieldsForIndex
|
||||
use App\Repos\Order\Card\CardOrderRepo;
|
||||
use App\Repos\Order\Card\CardTypeRepo;
|
||||
use App\Repos\Order\OrderRepo;
|
||||
use App\Repos\Payment\OnlinePaymentRepo;
|
||||
use App\Repos\System\Nova\NovaRepo;
|
||||
use App\Repos\System\Settings\Legal\PassportRepo;
|
||||
use App\Repos\System\Settings\Location\RegionRepo;
|
||||
@@ -31,6 +32,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\NovaInputmask\NovaInputmask;
|
||||
|
||||
class CardRequisite extends Resource
|
||||
@@ -156,6 +158,20 @@ class CardRequisite extends Resource
|
||||
$model->update(['unique_id' => CardOrderRepo::fillUniqueId($model)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the location to redirect the user after creation.
|
||||
*
|
||||
* @param \Laravel\Nova\Resource $resource
|
||||
*/
|
||||
public static function redirectAfterCreate(NovaRequest $request, $resource): URL|string
|
||||
{
|
||||
$payment = (new OnlinePaymentRepo())->payCardOrder($resource);
|
||||
|
||||
return $payment['status'] === 'success'
|
||||
? URL::remote($payment['url'])
|
||||
: sprintf('resources/%s/%s', static::uriKey(), $resource->getKey());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fields for index.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user