Skip to content

Conversation

@yajra
Copy link
Owner

@yajra yajra commented Mar 20, 2025

This PR aims to add the following ability for Editor.

  • Delegate action to its own class.

Editor

    protected array $customActions = [
        'remove2fa' => Actions\Remove2FA::class,
        'changePassword',
    ];

Action

use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class Remove2FA
{
    public function handle(Request $request): JsonResponse
    {
        return new JsonResponse([
            'message' => '2FA has been removed successfully.',
        ]);
    }
}
  • Change toJson() visibility to public
  • Change process() method and made the $request param optional
public function store(UsersEditor $editor)
{
  return $editor->process();
}

@yajra yajra merged commit 94e15b3 into master Mar 20, 2025
@yajra yajra deleted the actions branch March 20, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants