-
Is it possible to have an action that is both standalone and can be used on a single or multiple resource? I think its the same question as posted here #2211 and was marked as implemented but I can't see anything in the documentation on this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I believe you can register the action twice and handle both scenarios. Standalone actions will always receive an empty collection, and you can also check against |
Beta Was this translation helpful? Give feedback.
-
This has been fixed with v3.25.0 release. Example: /**
* Get the actions available for the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function actions(Request $request)
{
return [
new Actions\Sleep,
Actions\Sleep::make()->standalone(),
];
} Without selecting any resourcesWith selected resources |
Beta Was this translation helpful? Give feedback.
This has been fixed with v3.25.0 release.
Example:
Without selecting any resources
With selected resources