PHPackages                             rhysnhall/laravel-socketlabs-driver - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. rhysnhall/laravel-socketlabs-driver

ActiveLibrary

rhysnhall/laravel-socketlabs-driver
===================================

Laravel mail driver for SocketLabs injection API.

1.0.0(4y ago)210.3k↑19.7%MITPHPPHP ^7.3|^8.0

Since Dec 30Pushed 4y ago1 watchersCompare

[ Source](https://github.com/rhysnhall/laravel-socketlabs-driver)[ Packagist](https://packagist.org/packages/rhysnhall/laravel-socketlabs-driver)[ RSS](/packages/rhysnhall-laravel-socketlabs-driver/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Laravel SocketLabs Driver
=========================

[](#laravel-socketlabs-driver)

[![Latest Stable Version](https://camo.githubusercontent.com/7b92c9207f656c83bad018903d51b443991eca5bbaca0d056a1baec8723dae0f/687474703a2f2f706f7365722e707567782e6f72672f726879736e68616c6c2f6c61726176656c2d736f636b65746c6162732d6472697665722f76)](https://packagist.org/packages/rhysnhall/laravel-socketlabs-driver)[![PHP Version Require](https://camo.githubusercontent.com/dd534acdc83adbca3cd14e64ce4f42c92d2a58efec80bee887a35dd5c0bc3dfa/687474703a2f2f706f7365722e707567782e6f72672f726879736e68616c6c2f6c61726176656c2d736f636b65746c6162732d6472697665722f726571756972652f706870)](https://packagist.org/packages/rhysnhall/laravel-socketlabs-driver)

Adds a driver for the SocketLabs Injection API to Laravel's email services.

Requirements
------------

[](#requirements)

- PHP 7.3 or greater.
- A [SocketLabs](socketlabs) account with a server ID and API key.

Install
-------

[](#install)

Install the package with composer.

```
composer require rhysnhall/laravel-socketlabs-driver
```

Setup
-----

[](#setup)

Once you register and set up an account with SocketLabs, you'll be presented with a server ID and an API key. Add both of these to your ENV file.

```
SOCKET_LABS_API_KEY={your_key}
SOCKET_LABS_SERVER_ID={server_id}

```

Next, add the SocketLabs credentials to your `config\services.php` config file.

```
'socketlabs' => [
  'key' => env('SOCKET_LABS_API_KEY'),
  'id' => env('SOCKET_LABS_SERVER_ID')
]
```

Add the SocketLabs service provider to the `config\app.php` config file.

```
'providers' => [
  ...
  Rhysnhall\LaravelSocketLabsDriver\SocketLabsServiceProvider::class
]
```

The last step is to add the SocketLabs driver to the `config\mail.php` config file.

```
'mailers' => [
  ...
  'socketlabs' => [
    'transport' => 'socketlabs'
  ]
]
```

You may also want to set SocketLabs as your default mailer, depending on your setup. You'll need to update the `MAIL_MAILER` variable in your ENV file.

```
MAIL_MAILER=socketlabs

```

Config
------

[](#config)

You can directly add your config variables to the `config\mail.php` config file or create a new config file to hold these.

**config\\mail.php**

```
'mailers' => [
  ...
  'socketlabs' => [
    'transport' => 'socketlabs',
    'retries' => 2,
    'timeout' => 120,
    'proxy_url' => 'https://example'
  ]
]
```

**config\\socketlabs.php**

```
