cesargb / laravel-magiclink

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

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

Closed cesargb closed 3 years ago

cesargb commented 3 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';
      })
);