Action::make(__('classifieds.withdraw')) ->action(fn() => dd('foobar')) ->hidden(fn($record): bool => blank($this->token or $this->token !== $record->token or filled($record->deleted_at))) ->visible(fn ($record): bool => filled($record->paid_at and filled($record->receipt_url))) ->icon('heroicon-m-trash') ->color('danger'),
Action::make(__('classifieds.withdraw')) ->action(fn() => dd('foobar')) ->visible(function (Request $request, $record) { return true; }) ->icon('heroicon-m-trash') ->color('danger'),
Action::make(__('classifieds.withdraw')) ->action(fn() => dd('foobar')) //->visible(function (Request $request, $record) { // if (empty($request->token) or $request->token !== $record->token) // { // return false; // } // // if ($record->deleted_at) // { // return false; // } // // if ($record->paid_at && $record->receipt_url) // { // return true; // } // // return false; // //}) ->icon('heroicon-m-trash') ->color('danger'),
Action::make(__('classifieds.withdraw')) ->action(fn() => dd('foobar')) ->visible(function (Request $request, $record) { if (empty($request->token) or $request->token !== $record->token) { return false; } if ($record->deleted_at) { return false; } if ($record->paid_at && $record->receipt_url) { return true; } return false; }) ->icon('heroicon-m-trash') ->color('danger'),
#[Url(history: true)] public $token = '';
$request->token