DomainVerificationController.php 676 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Http\Controllers;
  3. class DomainVerificationController extends Controller
  4. {
  5. public function __construct()
  6. {
  7. $this->middleware('throttle:6,1');
  8. }
  9. public function checkSending($id)
  10. {
  11. $domain = user()->domains()->findOrFail($id);
  12. // Check MX records separately
  13. if (! $domain->checkMxRecords()) {
  14. return response()->json([
  15. 'success' => false,
  16. 'message' => 'MX record not found or does not have correct priority. This could be due to DNS caching, please try again later.',
  17. ]);
  18. }
  19. return $domain->checkVerificationForSending();
  20. }
  21. }