adds button to email user list of assets from profile

This commit is contained in:
Godfrey M
2022-06-29 11:15:15 -07:00
parent f8fd87b896
commit e471aa8639
5 changed files with 34 additions and 0 deletions
@@ -23,6 +23,7 @@ use Redirect;
use Str;
use Symfony\Component\HttpFoundation\StreamedResponse;
use View;
use App\Notifications\CurrentInventory;
/**
* This controller handles all actions related to Users for
@@ -614,6 +615,19 @@ class UsersController extends Controller
->with('show_user', $show_user)
->with('settings', Setting::getSettings());
}
public function emailAssetList($id)
{
$this->authorize('view', User::class);
if( User::where('id', $id)->first()->exists())
{
$user= User::where('id', $id)->first();
$user->notify((new CurrentInventory($user)));
return redirect()->back()->with('success', 'admin/users/general.user_notified');
}
return redirect()->back()->with('error', 'admin/accessories/message.user_does_not_exist');
}
/**
* Send individual password reset email