katsana / remote-control
Grant remote access to user account without sharing credentials
Installs: 7 784
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 5
Forks: 5
Open Issues: 0
Requires
- php: >=7.2
- illuminate/database: ^6.0 || ^7.0
- illuminate/mail: ^6.0 || ^7.0
- illuminate/support: ^6.0 || ^7.0
Requires (Dev)
- mockery/mockery: ^1.3.1
- orchestra/canvas: ^4.5 || ^5.0
- orchestra/testbench: ^4.5 || ^5.0
README
Grant remote access to user account without sharing credentials.
Installation
Remote Control can be installed via composer:
composer require "katsana/remote-control"
Configuration
The package will automatically register a service provider.
Next, you need to publish the Remote Control configuration file:
php artisan vendor:publish --provider="RemoteControl\RemoteServiceProvider" --tag="config"
Usages
Routing
Before creating any remote access, we need to declare verification route:
RemoteControl\Remote::verifyRoute('remote-control')->middleware('web');
To use signed URL you should include signed
middleware:
RemoteControl\Remote::verifyRoute('remote-control')->middleware(['signed', 'web']);
Creating Remote Access
You can create a remote access by running the following code:
$user = request()->user(); $recipientEmail = 'email@example.org'; $content = 'Please help me'; $accessToken = RemoteControl\Remote::create($user, $recipientEmail, $content);
Using Generated Access Token
You can get the URL using the following method:
$accessToken->getUrl();
You can also get signed URL using the following method:
$accessToken->getSignedUrl();
You can automatically send an email to the recipient via the following Mailable
:
Mail::send(new RemoteControl\Mail\GrantRemoteAccess($user, $accessToken, $content));