cesargb / laravel-magiclink

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

Add access_code feature #39

Closed rabol closed 3 years ago

rabol commented 3 years ago

I have added a middleware entry in the config file

Simple test

$downloadAction = new DownloadFileAction('/Test.pdf');
$downloadAction->disk('public');
$magicLink = MagicLink::create($downloadAction);
$magicLink->forceFill(['access_code' => Hash::make('test')]);
$magicLink->update();
return view('empty')->with('link',$magicLink->url);
cesargb commented 3 years ago

@rabol

Sorry for the delay. Your PR has good ideas and its functionality is a great improvement for this package.

I have added the tests and docs.

I have done a refactoring, mainly they are:

I think these changes can already be published in the new version. If you think any change is necessary, feel free to suggest it

Thanks!!

rabol commented 3 years ago

Hi

Happy to help - no need to change what you have added - my PR was just a quick solution.