Laravel FW-PHP s02
Laravel FW-PHP s02
02
SESSION
Fo
rA
pt
ec
h
C
en
tre
U
se
L ARAVEL
O
nl
y
INTRODUCTION TO
OBJECTIVES
y
nl
O
• Explain the details of Laravel framework
se
U
• Understand the need of frameworks
tre
en
• Describe the features of Laravel
C
h
• Learn to view the Laravel Directory structure
ec
pt
rA
Fo
y
nl
O
Open source PHP
framework
se
U
tre
en
Laravel
C
Framework
h
ec
pt
Uses the Model-View- An alternative to
Controller (MVC) CakePHP and
rA
y
nl
O
Framework is a basic templating structure that is used to develop, test,
se
and deploy applications rapidly and efficiently.
U
tre
Provide abstraction
en
C
Purpose of Frameworks Handles repetitive and menial tasks
h
ec
pt
Arranges things in a logical structure
rA
Fo
y
nl
O
se
Laravel Framework
U
tre
en
Reuses and assembles existing To build Web applications in a
C
components, dependencies, and libraries structured manner
h
ec
pt
rA
Fo
y
nl
O
Convention over
se
Configuration
U
tre
Extensive MVC
Library Architecture
en
C
h
ec
pt
Artisan
Helper
Command for
rA
Functions
Automation
Fo
y
nl
O
Convention over Configuration
se
U
• Can predict the dependencies
tre
en
• Automate the configuration related tasks
C
• Reduces the time and effort required to set up and
h
configure services
ec
pt
• Suitable for Rapid Application Development
rA
Fo
y
nl
MVC Architecture
O
se
U
tre
en
C
h
ec
pt
rA
Fo
y
nl
O
se
Artisan Commands
U
tre
• Automation tool
en
• Used to create models, views, and controllers
C
• Used to create dummy server
h
• ec
Perform database operations
pt
rA
Fo
y
nl
O
Code snippet to get a list of commands available for artisan: php artisan list
se
U
php artisan list
tre
en
C
h
ec
pt
rA
Fo
y
nl
O
Helper Function
se
U
• Global PHP functions
• Reduces time and effort
tre
en
Helper functions are classified as follows:
C
h
• Arrays and Objects
• Paths
ec
pt
• Strings
• URLs
rA
• Miscellaneous
Fo
y
nl
O
Extensive Library
se
U
• Includes a lot of popular and commonly used
tre
libraries
en
• Reduces time and effort
C
Code snippet that allows inclusion of external libraries using the
h
composer package manager: ec
pt
rA
y
nl
Creating a Laravel application:
O
se
laravel new laravelProject
U
View the directory structure:
tre
cd laravelProject
en
ls
C
Output of the command :
h
ec
pt
rA
Fo
y
nl
O
app
directory
vendor bootstrap
se
directory directory
U
tre
tests config
directory directory
en
Directory
structure in
C
Laravel
h
storage database
directory directory
ec
pt
rA
routes public
directory directory
resources
Fo
directory
y
nl
Laravel is an open source PHP framework for users working on Web application
O
development.
se
A framework is a basic templating structure that is used to develop, test, and deploy
U
applications rapidly and efficiently.
tre
The Laravel framework reuses and assembles existing components, dependencies, and
libraries to automate time-consuming tasks.
en
Laravel includes a consistent API.
C
h
Laravel has many conventions, if followed, can predict the dependencies and automate the
ec
configuration related tasks.
pt
Laravel is based on the Model–View–Controller (MVC) architecture.
rA
Laravel utilizes helper functions in its classes, functions, and even configurations.
Fo