1. Go to this page and download the library: Download filippo-toso/laravel-mailog library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use FilippoToso\LaravelMailog\Http\Controllers\Concerns\IsMailogController;
class MailogMessageController extends Controller
{
use IsMailogController {
query as mailogQuery;
}
/**
* The query that filters the messages
*
* @param array $filters
* @return Builder
*/
protected function query(array $filters) {
return parent::mailogQuery()
->where('tenant_id','=', tenant('id'));
}
}
use FilippoToso\LaravelMailog\Transport\MailogTransport;
use Symfony\Component\Mime\Email;
class MailogTransportWithTenant extends MailogTransport
{
/**
* Build the message data to be stored in the database
* You can override this method to add more fields to the message
*
* @param $messageId
* @param Email $converdedEmail
* @return array
*/
protected function messageData(string $messageId, Email $converdedEmail)
{
return array_merge(parent::messageData($messageId, $converdedEmail),[
'tenant_id' => tenant('id'),
]);
}
}