I registered following routes on my
web.php
file
Route::domain('{domain}.project.test')->group(function () {
Route::get('/', function ($domain) {
return view('welcome',compact('domain'));
});
Auth::routes(['verify' => true]);
Route::get('/home', 'HomeController@index')->name('home')->middleware('verified');
});
I had to pass the domain variable into
welcome.blade.php
in order to pass it intoroute()
method
<div class="top-right links">
@auth
<a href="{{ url('/home') }}">Home</a>
@else
<a href="{{ route('login',$domain) }}">Login</a>
<a href="{{ route('register',$domain) }}">Register</a>
@endauth
</div>
is there any way to pass
$domain
variable on to theroute()
method by default