Merge pull request #8 from kingjaypee12/jp/sales-clean-up
feat(SaleResource): redirect to client after sale creation
This commit is contained in:
@@ -89,8 +89,12 @@ class CreateSale extends CreateRecord
|
||||
return $record;
|
||||
}
|
||||
|
||||
protected function afterCreate(): void
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
$branch = Branch::find($this->data['branch_id']);
|
||||
$client = $this->getClient();
|
||||
if (! $client) {
|
||||
return parent::getRedirectUrl();
|
||||
}
|
||||
return ClientResource::getUrl('view', ['record' => $client->id]).'?activeRelationManager=3';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user