BestDivision Logo

Laravel Project Installation

BestDivision
BestDivision  @bestdivision
Created At - 2020-09-20
Last Updated - 2024-08-28

Table of Contents

  • Laravel Existing Project Setup
    • 1: Laravel Backend and React Front End.
    • 2: Create a file axios.js and paste the following command.
    • 3: Using Axios to make a GET request.

Laravel Existing Project Setup

Here's an example of how to install and set up a Laravel project:

Install Composer: Before installing Laravel, you need to have Composer installed on your system. You can download Composer from https://getcomposer.org/.

Create a new Laravel project: To create a new Laravel project, open a terminal and run the following command:

  1. Change to the project directory: After creating the project, change to the project directory with the following command:
  1. Configure database: In your Laravel project, you need to configure the database settings in the .env file. You can copy the .env.example file to .env and set your database credentials. For example:
  1. Generate application key: Laravel uses an application key to secure user sessions and other encrypted data. To generate an application key, run the following command:
  1. Serve the application: To start a development server and serve the application, run the following command:
  1. Access the application: Open your web browser and access the URL http://localhost:8000. You should see the default Laravel welcome page.

By following these steps, you should have a basic Laravel project installed and set up. You can start building your application by adding routes, controllers, models, and views to the project.

1: Laravel Backend and React Front End.

NOTE: Those who are using php version greater 8.0 then you need to do two more steps:

  1. composer install --ignore-platform-reqs

2: Create a file axios.js and paste the following command.

3: Using Axios to make a GET request.

a) Open App.js ( the file you want to make call from ).

b) Import axios file you made in step 2. 

So, the above function will make a get request and log the response in console.

Share

‌

  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌