DEV Community

Waqar Hussain
Waqar Hussain

Posted on

Laravel sub-domain cpanel

This guide describes how to configure a subdomain for laravel project.

if you own and want to create and handle it with laravel.
then follow these steps.

  1. Create a subdomain in cpanel and point its directory to the laravel project directory.
  2. now in your routes/web.php add this snippet.

Route::domain('')->group(function () {
    //mobile routes
    Route::get('/', function(){
        dd("Reserved For Site") ;

Now visit

and you will get

Reserved For Site

I wrote the first time, and I am looking forward to hearing your opinion on how can I improve.


Discussion (0)