
To connect your app to a database, you must create a new database using XAMPP’s PHPMyAdmin graphical user interface.

On localhost:8000, you should see something like this: Laravel Create a Database This code begins the project and connects it to localhost:8000 or any other available port if port 8000 is in use. You can now change the directory to app-name and start the project using Laravel’s own command-line interface (CLI) tool, Artisan: php artisan serve You don’t need to install the Laravel installer when using the method above. composer create-project laravel/laravel app-name This code bootstraps a new Laravel project and installs all the dependencies: Creating the Laravel projectĪnother easier way to install Laravel is to use Composer directly. Next, create a Laravel project by running the following: laravel new app-name This code installs the Laravel installer globally on your machine. To create a Laravel project quickly, install the Laravel installer: composer global require laravel/installer
#XAMPP LOCALHOST HOW TO#
Let’s take a look at all that entails and how to accomplish it. In this section, you’ll create a Laravel project and connect it to a database. Laravel Model factories can help! Here's how ⬇️ Click to Tweet How To Set Up the Project Testing your app shouldn't be an afterthought. You can also download the complete code for the project to follow along.

You use Composer to install the Laravel installer for this tutorial. This tutorial uses version v2.4.4 of Composer, which requires PHP version 7.2+. This tutorial uses XAMPP on Windows.Ĭomposer is a tool that allows you to define, install and download the packages your web app depends on in development and production. Read this article if installing XAMPP for MacOS or this guide for Linux. This tutorial uses the latest version, 8.1.10, which installs PHP 8.1.10. XAMPP is a free and easy-to-install Apache distribution that contains PHP, Perl, and MariaDB - a MySQL database. To complete this tutorial, you must be familiar with the following:
