Laravel Project Setup Guide
Prerequisites:
Before you begin, ensure you have the following installed:
-
Git: Git is a version control system for tracking changes in source code. Download Git from here and follow the installation instructions for your operating system.
-
PHP: Laravel requires PHP version 7.3 or higher. Check your PHP version by running
php -v
in your terminal. If you don’t have PHP installed, visit php.net for installation instructions. -
Composer: Composer is a PHP dependency manager used to install Laravel and its packages. Download Composer from here and follow the installation instructions.
-
Web Server: While Laravel comes with a built-in development server, for production environments, it's recommended to use Apache or Nginx. Ensure one of these is installed on your system.
-
Database: If your project uses a database, ensure you have a database management system installed (e.g., MySQL, PostgreSQL, SQLite).
Steps to Clone and Set Up the Project:
-
Clone the Repository: Open a terminal or command prompt and navigate to the directory where you want to clone your Laravel project. Then, run the following command:
git clone https://gitlab.com/SoengSouy/laravel11-with-premium-dashboard-template.git
-
Navigate to the Project Directory: Change into the project directory:
cd <project-directory>
-
Install Composer Dependencies: Laravel uses Composer to manage dependencies. Run the following command to install the necessary packages:
composer install
-
Create a Copy of the Environment File: Laravel requires an environment
.env
file for environment configurations. Create a copy of the.env.example
file and rename it.env
:cp .env.example .env
-
Update Database Credentials: Open the
.env
file and update your database connection settings:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_db_name DB_USERNAME=root DB_PASSWORD=your_database_password
-
Generate the Application Key: Run the following command to generate a unique application key:
php artisan key:generate
-
Run Database Migrations: Run the following command to apply database migrations and create the necessary tables:
php artisan migrate
-
Serve the Application: You can now start the Laravel development server by running:
php artisan serve
This will make your application accessible at http://localhost:8000 by default.
Conclusion:
With these steps completed, your Laravel application should be up and running. You can now access it through your browser at http://localhost:8000
.
If you have any questions or run into issues, feel free to refer to the Laravel documentation or reach out for help!