cesargb / laravel-magiclink

Create link for authenticate in Laravel without password or get private content
MIT License
359 stars 43 forks source link

The magiclink object is injected upon receiving the call of the ResponseAction class #43

Closed cesargb closed 2 years ago

cesargb commented 2 years ago

You can access to magiclink object when call ResponseAction function

$magiclink = MagicLink::create(new ResponseAction(
    function ($magiclink) {
           if (Auth::user()->actived) {
               $magiclink->delete();

                return 'your account was activated';
            }

            return 'active your account';
      })
);