You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CreateBuyableOffering.php 684B

123456789101112131415161718192021
  1. <?php
  2. namespace App\Filament\Company\Resources\Purchases\BuyableOfferingResource\Pages;
  3. use App\Filament\Company\Resources\Purchases\BuyableOfferingResource;
  4. use App\Filament\Company\Resources\Sales\SellableOfferingResource;
  5. use Filament\Resources\Pages\CreateRecord;
  6. class CreateBuyableOffering extends CreateRecord
  7. {
  8. protected static string $resource = BuyableOfferingResource::class;
  9. protected function getRedirectUrl(): string
  10. {
  11. if ($this->record->income_account_id && ! $this->record->expense_account_id) {
  12. return SellableOfferingResource::getUrl();
  13. } else {
  14. return $this->getResource()::getUrl('index');
  15. }
  16. }
  17. }