Laravel Subdomain - localhost

'name'     => 'Shah Md. Iktakhairul Islam',
'email' => 'iktakhairul@gmail.com',
'password' => Hash::make('admin'),
'domain' => 'developer',
'role' => 'developer',
'weight' => 59.00,
APP_URL=http://laravel-sub-domain.com
SUB_URL=laravel-sub-domain.com
'short_url' => env('SUB_URL', 'http://localhost'),
'domain' => env('SESSION_DOMAIN', '.laravel-sub-domain.com'),
Route::domain('{subdomain}.'.config('app.short_url'))->group(function () {    Route::resource('users', UserController::class);
Route::resource('products', ProductController::class);
});
public function index($subdomain)
{
$users = DB::table('users')->get();

return view("users.index", compact('users', 'subdomain'));
}
public function create($subdomain)
{
return view("users.create", compact('subdomain'));
}
127.0.0.1 localhost127.0.0.1 laravel-sub-domain.com127.0.0.1 system.laravel-sub-domain.com
127.0.0.1 developer.laravel-sub-domain.com
public function logout(Request $request)
{
$this->guard()->logout();
$request->session()->invalidate();
$request->session()->regenerateToken();

return redirect()->to('http://laravel-sub-domain.com:8000/');

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store