In this laravel tutorial I will share a laravel tutorial for beginners with the scope of how to create a new project and file structure of laravel files.
Previously I assumed you already understood how to install composer and laravel, in this tutorial I use laravel version 9, if there is not yet able to install composer and laravel can be checked here. I also assume you have installed xampp as a local server, if not you can check here. and you must also have a text editor like Vscode.
Laravel tutorial for beginners part 1(Create new project, file structure of laravel)
Table of Contents :
- Create New Project
- Project Structure Of Laravel
CREATE NEW PROJECTS
Please enter the htdocs directory via the command prompt as shown below :
photo by webbaliseo
Laravel uses composer to manage or manage or manage each project, before you create a new project you can use the command:
“composer create-project laravel/laravel=version nama_folder”
New project of laravel in progress – photo by webbaliseo
Wait for the process to be successful.
PROJECT STRUCTURE
After the process of creating new project is successful, the project structure looks like the following picture:
project structur of laravel – photo by webbaliseo
or you can check the file in the xampp>htdocs>learnlaravel folder. here we will discuss one by one the contents of the folder in our laravel project.
-
APP folders
This APP folder is where we store our program code later, be it class, method or function
-
Bootstrap folder
The Bootstrap folder is Laravel’s default folder where Laravel will run the Bootstrapping process during the initial application process, I suggest not to change or delete the contents of this bootstrap folder.
-
Config folder
The config folder is our place to store our configuration files, for example application configuration, database configuration, system, logging, email and others.
- Databases Folders
For those of you who use databases, Laravel supports database migrations, which means that if we want to create tables, we don’t need to manually anymore because we can use Laravel’s own database migrations.
- Lang folder
Laravel supports internationalization which means we can create websites with multiple languages, in this lang folder we will create them.
- Public Folders
The public folder is the first entry point or folder visited by the web server and then opens the index.php file in the public folder, in the index.php file it will run app.pp in the bootstrap folder as shown below
public folder – photo by webbaliseo
-
Resources folder
You can include resource files such as css, javascript or images / photos in this resources folder, in this resources folder is also where you put your templates (views), all files that you don’t want to be accessed by the public you can place in resources folder.
-
Routes folder
In laravel there is a name called routing, so all endpoint routing files will be placed here.
-
Storage Folders
We can store our files in this storage folder.
- Tests folder
This folder is where we store our unit tests in making applications.
-
Vendors Folder
This vendor folder is default from composer, so all the libraries that we use in our project will be downloaded in this vendor folder.
That’s the Laravel tutorial for beginners in creating a new project and getting to know the laravel file structure that’s in it and See you in part 2.
You may also want to see the other of laravel tutorial below :