Laravel Subdomain - localhost

'name'     => 'Shah Md. Iktakhairul Islam',
'email' => 'iktakhairul@gmail.com',
'password' => Hash::make('admin'),
'domain' => 'developer',
'role' => 'developer',
'weight' => 59.00,
  1. .env
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/');

--

--

--

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 Choise.com 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 ?