Laravel Installation and Folder Structure Guides

The steps for creating Laravel Projects →

  • Composer Download and Installation
  • Laravel Installation and Folder Structure

Here are the steps to download and install PHP:

  1. Go to the Link to the official PHP website.
  2. Scroll down to the “Windows Binaries” section and click on the link for the version of PHP that you want to download.
  3. Choose the ZIP package that matches your system architecture (32-bit or 64-bit).
  4. Extract the contents of the ZIP file to a folder on your computer. For example, you could extract it to C:\php.
  5. Rename the file php.ini-development to php.ini.
  6. Edit the php.ini file to configure PHP settings as needed.
  7. Add the directory containing the PHP executable file (php.exe) to your system’s PATH environment variable.
  8. Restart your web server.

That should be it! You should now have PHP installed on your system and ready to use.

Here are the steps for downloading and installing Composer:

  1. Open any web browser and go to the Link.
  2. Scroll to the “Command-line Installations” section and copy the code snippet provided there, or see the screenshots.
  3. Open a terminal or command prompt window on your computer.
  4. Paste the code snippet you copied into the terminal/command prompt window and press enter. After, this will download all the setup files for the composer.
  5. Open the folder where the composer setup file is downloaded after finishing the download.
  6. Move the setup file to a directory in your PATH so that you can run the composer command from anywhere on your system. For example, you might move the file to /user/local/bin/ on a Unix-based system.
  7. To test that Composer is installed correctly, open a new terminal/command prompt window and type composer. This should display the Composer version number and a list of available commands, see the screenshot.

Congratulations, now you have Composer installed on your computer successfully!

Here are the steps for installing Laravel’s latest version:

Before start installing Laravel, you need to configure two more things called:

  1. Before installing Laravel, you’ll need PHP 7.4 or later, as well as several required extensions and libraries. To download and install PHP, you can follow the guides (Links).
  2. Install Composer: Laravel uses Composer to manage its dependencies, so you’ll need to install it if you haven’t already. You can follow the guide (Link) for installing and downloading Composer.

Now furthermore, for installing a Laravel Project,

  1. Install Laravel: Once you have Composer installed, you can use it to install Laravel by running the following command in your terminal:
    composer create-project — prefer-dist laravel/laravel myproject
    (screenshot)
  2. Set up your environment: Laravel requires a few environment variables to be set up to function properly, such as database information. You can copy the “.env.example” file to “.env” and fill in the necessary values.
  3. Run migrations: If you plan on using a database with your Laravel application, you’ll need to run the migrations to set up the necessary tables. You can do this by running the following command:
    php artisan migrate
  4. Test your installation: Finally, you can test your installation by running the following command:
    php artisan serve
  5. This will start a development server, and you should be able to access your application by navigating to this link in any web browser.

Here’s a brief overview of the purpose of each folder in a typical Laravel project:

app: The app folder contains the core application code, including models, controllers, middleware, model, and other PHP classes.

bootstrap: The bootstrap folder contains the files that Laravel loads when it starts up, such as the app.php file which sets up the service container and initializes various components.

config: This folder contains all the configuration files for the application, including database connections, mail settings, and more.

database: It includes migrations, seeders, and factories for the database.

public: The public folder is the web root of the application and contains the index.php file, which serves as the entry point for all HTTP requests.

resources: It includes views, CSS, JavaScript, language files, and other assets.

routes: This folder contains all of the route definitions for the application, including both web and API routes.

storage: This folder contains files generated by the framework, such as logs, cache data, sessions, compiled views, and uploaded files.

tests: The tests folder contains automated test scripts written using PHPUnit.

vendor: This folder contains all the third-party libraries and packages that your application depends on. It is managed by Composer and should not be edited manually.

Running Routes → https://prnt.sc/DcLbQEO87JCn

Leave a Reply

Your email address will not be published. Required fields are marked *