Laravel Subdomain - localhost

'name'     => 'Shah Md. Iktakhairul Islam',
'email' => '',
'password' => Hash::make('admin'),
'domain' => 'developer',
'role' => 'developer',
'weight' => 59.00,
  1. .env
'short_url' => env('SUB_URL', 'http://localhost'),
'domain' => env('SESSION_DOMAIN', ''),
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'));
} localhost127.0.0.1 laravel-sub-domain.com127.0.0.1
public function logout(Request $request)

return redirect()->to('');




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Challenge: Enemies That Can Dodge Projectiles

Open Source and the Theory of Constraints

T👀LS for Decentralized Education: Creating Truly Open Online Learning Systems

A Healthy Dialogflow Part II: Development, Deployment, and Analysis

iOS testing — 4 crossroads technique — Part 2

Coursera Guided Projects (Review January 2021)

Huge Airdrop Distribution

Infrastructure drifts aren’t like Pokemons…

Fosdem talk about infrastructure drift

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
Shah Md. Iktakhairul Islam

Shah Md. Iktakhairul Islam

More from Medium

Send push notifications using OneSignal with Flutter, Firebase & PHP Laravel.

Laravel | How to extend Notifications and use your custom fields

Shopify App With Laravel, InertiaJs, and Polaris

How To Install Laravel ?