Subdomain validator for Laravel.
This package requires Laravel 5.5 or higher.
You can install this package via composer using this command :
composer require kristories/laravel-rsd
The package will automatically register itself.
Publish the configuration file :
php artisan vendor:publish --tag=config
// Route
Route::group(['domain' => '{account}.domain.tld'], function () {
Route::middleware(['rsd'])->group(function () {
Route::get('/', function () {
return view('welcome');
});
});
});
// Kernel
protected $routeMiddleware = [
'rsd' => \Kristories\Rsd\Rsd::class,
];
Or
// Route
Route::group(['domain' => '{account}.domain.tld'], function () {
Route::get('/', function () {
return view('welcome');
});
});
// Kernel
rotected $middleware = [
\Kristories\Rsd\Rsd::class,
];
RSD_DRIVER=array
'subdomains' => [
'dev',
'staging',
'private',
'reserved',
'status',
],
RSD_DRIVER=database
'model' => App\YourModel::class
use Kristories\Rsd\ReservableTrait;
use Illuminate\Database\Eloquent\Model;
class YourModel extends Model
{
use ReservableTrait;
protected $reserved_column = 'name';
}
use Kristories\Rsd\ReservableTrait;
use Illuminate\Database\Eloquent\Model;
class YourModel extends Model
{
use ReservableTrait;
protected $reserved_column = 'name';
public function scopeReservedExtra($query)
{
return $query->where('active', true);
}
}
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.