Created
August 9, 2019 17:22
-
-
Save msaladna/8feeada8ac3edf4a08a3eef225a817e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Models; | |
use App\Http\Controllers\ServerLookupController; | |
use Illuminate\Contracts\Support\MessageBag; | |
class MailConfig { | |
const MY_DOMAIN = 'hostineer.com'; | |
public static function lookup($domain) { | |
$server = 'mail.' . $domain; | |
$controller = \App::make(ServerLookupController::class); | |
$data = $controller->callAction('findDomain', ['domain' => $domain]); | |
if (!$data instanceof MessageBag) { | |
$server = $data; | |
} | |
return $server . '.' . ServerLookupController::MY_DOMAIN; | |
if (!$server) { | |
return 'mail.' . $domain; | |
} | |
return $server . '.' . ServerLookupController::MY_DOMAIN; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment