How To Start Laravel Framework

By | March 28, 2021

Introduction of Laravel-: Laravel is a PHP framework. Laravel is a most php framework. it was release in June 2011. Current version of laravel 8.0. It’s developer name was Taylor Otewell. It was written in php. Laravel is use for creating web app(for creating a website and CRM,ERP) and API. Laravel is a open source framework and its free.

laravel tutorial

Importance Of Laravel

We start the laravel it is necessary to know that why we use the laravel. There are many reason for using laravel. These are the

1-:Strong command line support-: Laravel support for command line means we can use command line for installing laravel. Its documentation are very good and understandable. The document are written clearly that’s are good .

2-:Regular updates -: It’s are regular updated means in the one years 2 update version comes. It is updating.

3-:Large Community -: laravel has a large community. It is using lot of the developer for developing web API etc. You can find any solution easily in laravel

4. Fast and Simple-: Laravel work on MVC (Model View Controller) pattern. It is very fast and simple to learn.

How To Start Laravel Framework

Requirement of starting Laravel -: There are some requirement for installing laravel. First we need Php 7.3 or grater then version. This is necessary to installing laravel. For checking the version of php type this command php -v and press enter its show the version of php if you have less then 7.3 php then update it.

Install Composer -: Composer is a php dependency manager. when we are using php framework there are lot of dependency.

How to install composer in laravel

For install composer there are two way.

1-: we go to google search engine and search composer. Now open it https://getcomposer.org/ Here are many option available like here.

composer download

Here we click the download button now a window will open here. we can download it and install it.

2-: There are another way for installing composer this is the command line. we use these command for installing laravel. First open the folder where you want to install composer using the cmd command. We use four command installing and uninstalling these are ..

(1) php -r “copy(‘https://getcomposer.org/installer’, ‘composer-setup.php’);” —: First run this command. It copy the setup now run the second command.

(2)-php -r “if (hash_file(‘sha384’, ‘composer-setup.php’) === ‘756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3’) { echo ‘Installer verified’; } else { echo ‘Installer corrupt’; unlink(‘composer-setup.php’); } echo PHP_EOL;”
(3) php composer-setup.php -: when we run this command its started to downloading and installing. It’s take some time for installing.

(4) php -r “unlink(‘composer-setup.php’);” -: This command is use for uninstalling the composer.

Note- There are some time its give the composer is not found. in this condition we close the program and restart it.

How to create laravel project

Creating a project in laravel we can use this command. First open the xamp folder select httpdocs and create a new folder and give the name of folder or project name i am giving project name is netnic. Now open it netnic and in the file location type the cmd commnad and press enter. A window will open here then write this command

composer create-project laravel/laravel netnic

here are the project name is netnic or we can give the another name of this project.

Another way for installing laravel and make a project we use this command

composer global require laravel/installer

its takes some time. Giving this command laravel has been installed. Now we create the project here using this command.
laravel new netnic (here the project name the project name).

Now your project has been ready to use.

How to start laravel project -: We know that the laravel is a command line framework. for starting thee laravel project we use this command php artisan serve and press the enter here. It’s showing like here


Laravel development server started: http://127.0.0.1:8000
Now we open this link in browser.

File and folder structure in laravel-: After creating the project now start laravel. where we open it or which program we use in. You can use many software for opening laravel file and folder.

I will suggest you Notepad ++ is the best solution for opening laravel program. you can use visual code or subline text code also as your choice.

File and folder structure in laravel-: When we are creating project there are multiple file and folder are installed in laravel. I will tell you something about them. we know that the laravel is a open source framwork and its work on MVC . MVC mean Model view Controller.

When we open this project we saw here are many folders and file are created we will see all the folder and file one by one in short description. First is the App folder there are some folder list available here

  • Console
  • Exception
  • Http -: In this folder controller and middleware are two folder. In the controller we create all the controller that are using in project.
  • Models
  • Providers-: This are provide authorisation for example when we are doing sign in or we are creating signup page then these are uses

2- Bootstrap-
3-:config
4-: database -: in this folder multiple folder are available as like seeder,migration,factroy etc.
5-:Public
6-:resources -: In the resources there are multiple folder available as like css,js,lang,view etc.
View -: All the HTMl code are written in View folders. Suppose we write the HTML code here and save it to the file_name.blade.php its extension name is the blade.php for necessary.

7-:Routes -: there are 4 type file in the routes api.php,channel.php,console.php,web.php, Mostly we define all the roots file in routes.

8-Storages -:
9-test
10-vendor

Note -: When we create laravel project then its install all the package. There are multiple package installed these are available in our project. These are available in file as like .json file, .emv file etc.

Category: php

Leave a Reply

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