|
1 | 1 | # sun-asterisk/laravel-domain-verify |
2 | 2 |
|
3 | | -Verify domain ownership for the Laravel application. We provide three ways to verify the domain (like Google): |
| 3 | +Verify domain ownership for the Laravel application. We provide three ways to verify the domain ownership (like Google): |
4 | 4 |
|
5 | | -- [ ] Via domain's DNS record (txt record) |
6 | | -- [ ] Via HTML tag |
7 | | -- [ ] Via Adminstrator's email address. Supported: `[email protected]` and `[email protected]`. |
| 5 | +- [x] Via domain's DNS record |
| 6 | +- [x] Via HTML tag |
| 7 | +- [x] Via HTML file |
| 8 | +- [x] Via Adminstrator's email address: `[email protected]`, `[email protected]`. |
8 | 9 |
|
9 | 10 | ## Installation |
10 | 11 |
|
11 | 12 | First, install Domain Verifier via the Composer package manager: |
12 | 13 |
|
13 | 14 | ```bash |
| 15 | +# install this package: |
14 | 16 | composer require sun-asterisk/laravel-domain-verify |
15 | | -``` |
16 | | - |
17 | | -After that, you need to add provider `DomainVerifierServiceProvider` in `config/app.php`. |
18 | | -Now, you should publish the Domain Verifier configuration and migration via `artisan` command: |
19 | 17 |
|
20 | | -```bash |
| 18 | +# create config/domain_verifier.php and: |
21 | 19 | php artisan vendor:publish --provider="SunAsterisk\DomainVerifier\DomainVerifierServiceProvider" |
| 20 | + |
| 21 | +# migrate database: |
| 22 | +php artisan migrate |
22 | 23 | ``` |
23 | 24 |
|
24 | | -If you just want to publish only configuration or migrations: |
| 25 | +## Usage |
25 | 26 |
|
26 | | -```bash |
27 | | -php artisan vendor:publish --provider="SunAsterisk\DomainVerifier\DomainVerifierServiceProvider" --tag=config |
28 | | -php artisan vendor:publish --provider="SunAsterisk\DomainVerifier\DomainVerifierServiceProvider" --tag=migrations |
| 27 | +Integrate with your model. |
| 28 | + |
| 29 | +```php |
| 30 | +<?php |
| 31 | + |
| 32 | +namespace App\Models; |
| 33 | + |
| 34 | +// ... |
| 35 | +use SunAsterisk\DomainVerifier\Contracts\Models\DomainVerifiable; |
| 36 | +use SunAsterisk\DomainVerifier\Traits\DomainVerifiable as DomainVerifiableTrait; |
| 37 | +use SunAsterisk\DomainVerifier\Models\DomainVerification; |
| 38 | + |
| 39 | +class Website extends Model implements DomainVerifiable |
| 40 | +{ |
| 41 | + use DomainVerifiableTrait; |
| 42 | + |
| 43 | + //.. |
| 44 | +} |
29 | 45 | ``` |
30 | 46 |
|
31 | 47 | ## Requirements |
|
0 commit comments