

Once the XAMPP is Installed, you should be able to access the XAMPP Console from where you can start or stop the necessary services. If you are on MAC, the install location for XAMPP will be /Applications/XAMPP. Download the version for OSX (Mac).įollow the steps to install the XAMPP. Download it from the apache friends official website. Install XAMPPįirst of all we need to download and install XAMPP. Make sure to Install the XAMPP with version >= 7.2.0. Then in your web.php file : Route::domain( 'admin.Laravel 5.7 requires PHP version 7.1.3 or more, and some other extensions. So restart your xammp in your preferred way. The only thing we will do here is to uncomment this line # Include etc/extra/nf # Virtual hosts Include etc/extra/nfįor my own machine, I use this command to restart xammp The likely path should be, opt\lamp\etc\nf The ServerName refers to the domains we want to use. The DocumentRoot variable or section in side the virtualHost tag should point to the specific folder where your laravel project is and yes, even to the public folder of your laravel projec too "/opt/lampp/htdocs/laravel/siteproject/public" In that file we create two copies for virtual host using the code snippet like mine : //for site (root domain) ĭocumentRoot "/opt/lampp/htdocs/laravel/siteproject/public"ĮrrorLog "logs/-error_log"ĬustomLog "logs/-access_log" common We can locate nf in this path opt\lamp\etc\extra\nf To create a virtual host, the files we will be editing are nf and nf Let's move.Next ! Creating a virtual host Make sure you save the changes (I beg of you !.lol ) Next, Unlike the screenshot above, in our own situation, we assign site to 127.0.0.1 and same thing for admin.site to 127.0.0.1 127. Upon opening of hosts file, you should see something like this :

Right click on the hosts file then open it up with a text editor (I will recommend vscode or anyother text editor that lets you edit the file with an interface to enter your password incase that file requires a super or an admin user permissions) Go to your computer (root folder of your linux file manager, usually named "computer", open the etc folder, then inside that folder look for the file named, hosts. Then we will create a virtual host in a xammp file.We will edit the linux host file so we can point our subdomain names to the default IP address.Now, imagine we need to locally run a part of our laravel app feature on a subdomain say, Admin, so we should have something like /, right ? Normally, for your laravel application, you can access the traditional domain when you run php artisan serve, http: //127.0.0.1:8000 // or etc So, yeah, I had to gather my solution which were in bits in one article, this article ! This solution is for xampp users on linux(local)OS (ubuntu, etc) Let me just mention that, I researched alot of articles and Stackoverflow answers about this problem but none provided a solution peculiar to linux os / ubuntu.
