A Laravel wrapper for spatie/dns. Allows to query and validate DNS records.

Related tags

Laravel dns
Overview

Laravel DNS

Latest Version MIT License Offset Earth Larabelles

GitHub Workflow Status GitHub Workflow Status Total Downloads

Installation

composer require astrotomic/laravel-dns

Usage

use Astrotomic\Dns\Facades\Dns;

/** @var \Illuminate\Support\Collection $records */
$records = Dns::records('astrotomic.info', DNS_A);
use Astrotomic\Dns\Rules\DnsRecordExists;
use Spatie\Dns\Records\A;
use Spatie\Dns\Records\TXT;

return [
    'url' => [
        'required',
        'string',
        'url',
        // verify that domain of entered url
        // has any A, AAAA or CNAME record
        // and a TXT record with the users token
        DnsRecordExists::make()
            ->expect(DNS_A|DNS_AAAA|DNS_CNAME)
            ->expect(DNS_TXT, fn(TXT $record): bool => $record->txt() === 'token='.$this->user()->public_token),
    ],
    'email' => [
        'required',
        'string',
        'email',
        // verify that domain of entered email
        // has any MX record
        // and SPF setup
        DnsRecordExists::make()
            ->expect(DNS_MX)
            ->expect(DNS_TXT, fn(TXT $record): bool => str_starts_with($record->txt(), 'v=spf1 ')),
    ],
    'domain' => [
        'required',
        'string',
        // verify that entered domain
        // has an A record
        // pointing to our IP-address
        DnsRecordExists::make()
            ->expect(DNS_A, fn(A $record): bool => $record->ip() === '127.0.0.1'),
    ],
    'something' => [
        'required',
        'string',
        // verify that value is something with DNS
        DnsRecordExists::make(),
    ],
];
use Astrotomic\Dns\Domain;

protected $casts = [
    'domain' => Domain::class,
];
use Astrotomic\Dns\Domain;

/** @var \Astrotomic\Dns\Domain $domain */
$domain = Domain::make('[email protected]');

/** @var string|null $domain */
$domain = Domain::parse('[email protected]');
You might also like...
Implementation Package Spatie/Laravel-Permission

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

This package provides extended support for our spatie/enum package in Laravel.
This package provides extended support for our spatie/enum package in Laravel.

Laravel support for spatie/enum This package provides extended support for our spatie/enum package in Laravel. Installation You can install the packag

Forked from spatie-laravel-tags
Forked from spatie-laravel-tags

Add tags and taggable behaviour to a Laravel app This package offers taggable behaviour for your models. After the package is installed the only thing

Filament-spatie-laravel-activitylog - View your activity logs inside of Filament. ⚡️

View your activity logs inside of Filament. This package provides a Filament resource that shows you all of the activity logs created using the spatie

.env vars check for Spatie's Laravel Health

Custom check for Spatie's Laravel Health - Ensure every .env variable you need has a value

Proyecto Start-Basic sobre Login y crud de usuarios, mediante Api Rest, usando la plantilla AdminLte 3.1 y manejo de roles y permisos con spatie y autenticacion JWT
Proyecto Start-Basic sobre Login y crud de usuarios, mediante Api Rest, usando la plantilla AdminLte 3.1 y manejo de roles y permisos con spatie y autenticacion JWT

Proyecto Start-Basic sobre Login y crud de usuarios, mediante Api Rest, usando la plantilla AdminLte 3.1 y manejo de roles y permisos con spatie y autenticacion JWT

Laravel package to generate and to validate a UUID according to the RFC 4122 standard. Only support for version 1, 3, 4 and 5 UUID are built-in.

Laravel Uuid Laravel package to generate and to validate a universally unique identifier (UUID) according to the RFC 4122 standard. Support for versio

Otpify is a Laravel package that provides a simple and elegant way to generate and validate one time passwords.

Laravel Otpify 🔑 Introduction Otpify is a Laravel package that provides a simple and elegant way to generate and validate one time passwords. Install

Boilerplate code for protecting a form with proof of work. Uses javascript in the browser to generate the hashcash and PHP on the server to generate the puzzle and validate the proof of work.

Boilerplate code for protecting a form with proof of work. Uses javascript in the browser to generate the hashcash and PHP on the server to generate the puzzle and validate the proof of work.

Releases(0.2.0)
  • 0.2.0(Sep 22, 2022)

    What's Changed

    • support laravel 9 by @mattvb91 in https://github.com/Astrotomic/laravel-dns/pull/1

    New Contributors

    • @mattvb91 made their first contribution in https://github.com/Astrotomic/laravel-dns/pull/1

    Full Changelog: https://github.com/Astrotomic/laravel-dns/compare/0.1.0...0.2.0

    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Jun 1, 2021)

Owner
Astrotomic
We want to provide helpful, solid and easy to use open source packages. Most of them will be for Laravel - but sometimes also plain PHP.
Astrotomic
Update multiple Laravel Model records, each with it's own set of values, sending a single query to your database!

Laravel Mass Update Update multiple Laravel Model records, each with its own set of values, sending a single query to your database! Installation You

Jorge González 88 Dec 31, 2022
Stop duplicating your Eloquent query scopes and constraints in PHP. This package lets you re-use your query scopes and constraints by adding them as a subquery.

Laravel Eloquent Scope as Select Stop duplicating your Eloquent query scopes and constraints in PHP. This package lets you re-use your query scopes an

Protone Media 75 Dec 7, 2022
A Laravel package that allows you to validate your config values and environment.

Table of Contents Overview Installation Requirements Install the Package Publishing the Default Rulesets Usage Creating a Validation Ruleset Using the

Ash Allen 152 Dec 15, 2022
Effortlessly streamline tables and records printing in PDF/XLSX in your FilamentPHP application.

Filament Printables: a package to generate reports and form printables for your app. This is a work in progress thing Installation You can install the

fastOFI Corp 6 Jun 15, 2023
A laravel package to handle sanitize process of model data to create/update model records.

Laravel Model UUID A simple package to sanitize model data to create/update table records. Installation Require the package using composer: composer r

null 66 Sep 19, 2022
A WPDB wrapper and query builder library.

DB A WPDB wrapper and query builder library. Installation It's recommended that you install DB as a project dependency via Composer: composer require

StellarWP 35 Dec 15, 2022
A quiz application with laravel 8, spatie permissions, livewire, jetstream, chartjs, tailwindcss and more!

Todo Currently busy with some other important things, will definately would like to imporove the app with 1. Multiple choices selection and mapping to

Baig 67 Nov 21, 2022
Laravel Backup Panel provides a dashboard for spatie/laravel-backup package.

Laravel Backup Panel Laravel Backup Panel provides a dashboard for spatie/laravel-backup package. It lets you: create a backup (full | only database |

Pavel Mironchik 366 Dec 6, 2022
Laravel Nova filter for Spatie/laravel-tags

SpatieTagsNovaFilter This package allows you to filter resources by tags. (using the awesome Spatie/laravel-tags and Vue-MultiSelect ) Installation Fi

Mahi-Mahi 3 Aug 4, 2022
The query filter bundle allows you to filter data from QueryBuilder and the Database.

The query filter bundle allows you to filter data from QueryBuilder and the Database. you can filter multiple columns at the same time and also you can filter relation fields with two-level deep and without any join in your query builder.

Bugloos 15 Dec 29, 2022