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.

EditSellableOffering.php 830B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Filament\Company\Resources\Sales\SellableOfferingResource\Pages;
  3. use App\Filament\Company\Resources\Purchases\BuyableOfferingResource;
  4. use App\Filament\Company\Resources\Sales\SellableOfferingResource;
  5. use Filament\Actions;
  6. use Filament\Resources\Pages\EditRecord;
  7. class EditSellableOffering extends EditRecord
  8. {
  9. protected static string $resource = SellableOfferingResource::class;
  10. protected function getHeaderActions(): array
  11. {
  12. return [
  13. Actions\DeleteAction::make(),
  14. ];
  15. }
  16. protected function getRedirectUrl(): string
  17. {
  18. if ($this->record->expense_account_id && ! $this->record->income_account_id) {
  19. return BuyableOfferingResource::getUrl();
  20. } else {
  21. return $this->getResource()::getUrl('index');
  22. }
  23. }
  24. }