aurawindsurfing
aurawindsurfing
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
Thank you for your time!
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
Looks like it I need to test it further. Ill report back when Im sure it does
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
ok it work with the following:
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'))
->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'),
strange it does not with traditional functions tough
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
the moment you do early return the action does not kick in at all
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
actually even this works:
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) {
return true;
})
->icon('heroicon-m-trash')
->color('danger'),
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
but this works:
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'),
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
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'),
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
this does not work:
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
yes of course
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
only with $request in my case
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
no it does not work with $this
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
what I'm doing at the moment is this:
#[Url(history: true)]
public $token = '';
#[Url(history: true)]
public $token = '';
$request->token
$request->token
Should I be using $this->token instead to get actions to work? Let me try.
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
@Leandro Ferreira any ideas what might be causing it?
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
for the token detection
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
yes
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
the problem is when I use early return for some reason
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
it works as expected if I do that
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
yes the same result if I use getHeaderActions()
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
@Leandro Ferreira any ideas?
33 replies
FFilament
Created by aurawindsurfing on 6/26/2024 in #❓┊help
->action can not be used with ->visible on Resource View Page, why?
but I need them
33 replies