SlideShare a Scribd company logo
Object-Oriented
Programming

(with Laravel)
By: Shahrzad Peyman
Session 1
March-2017
shahrzad.peymaan@gmail.com
1
Today’s Presentation
▪ What is PHP?
▪ Object Oriented Programming
▪ Introduction to PHP Syntax
▪ Composer
▪ Framework
▪ MVC
▪ Laravel
2
What is PHP?
▪ PHP is a popular, general-purpose and server-side scripting
language that is especially suited to web development.
▪ Commonly used to build web applications.
▪ PHP: Personal Home Page --- Php Hypertext Preprocessor
▪ PHP (Hypertext Preprocessor) was created by Rasmus Lerdorf in
1994. It is now developed and improved by a large team of
people.
▪ http://www.php.net
3
PHP History
PHP2 1995 Added database support, file uploads,
variables, arrays, recursive functions,
conditionals, iterations, regular expression and
etc.
PHP3 1998 Added support of ODBC data sources, multiple
platform support, email protocol, and new parser
written by Zeev Suraski and Andi Gutmans.
PHP4 2000 The parser was renamed the Zend Engine. Many
security features were added.
PHP5 2004 Adds Zend Engine 2 with object oriented
programming, robust XML support, SOAP
extension for interoperability with Web Services,
SQLLite has been bundled with PHP.
PHP7 2015 Revolution in PHP
4
Scripting Language
▪ A scripting language is a programming language that employs a
high-level construct to interpret and execute one command at a
time.
▪ Interpreted at runtime
5
Who Uses PHP?
▪ Yahoo!
▪ Facebook (HACK)
▪ Wikipedia
▪ 20+ million other domain names
6
Which Tools Based on PHP?
▪ Wordpress (Blog engine)
▪ Drupal (CMS)
▪ Slack (Chat Service)
▪ Joomla (CMS)
➢As of January 2013, PHP was used in more than 240
million websites (39% of those sampled) and was installed on
2.1 million web servers.
7
Why I Choose PHP?
▪ Cost nothing, it is free to download and use.
▪ Open source
▪ Runs on different platforms
▪ Codes and solutions are easily available
▪ Lots and lots of knowledge and documentation
▪ Speed of development
8
Working of PHP?
9
Object-Oriented Programming
What is Object-Oriented Programming (OOP)?
Object-oriented programming (OOP) is a programming paradigm
based on the concept of "objects".
So,
Objects are key to understanding object-oriented technology.
10
What is Object?
❖Many examples of real-world objects
▪ your Book, your PC, your Mobile, your Computer mouse and so on.
❖Real-world objects share two characteristics:
▪ State
▪ Behavior
❖Software Objects
▪ Modeled after real-world objects.
▪ Maintains its states in variables or attributes.
▪ Implements its behaviors with methods.
11
Objects
▪ E.g. A Computer Mouse is a real-world Object. Its states would be
its color, size and brand name and its behaviors would be left-
click, right-click and middle click.
▪ Software object that modeled your real-world computer mouse.
▪ Have variables(attributes) that indicated the computer mouse’s current
states:
▪ Its color is black.
▪ Its size is medium.
▪ Its brand name is Genius.
▪ Have methods that indicated the computer mouse’s current behaviors
like left-click, right-click and middle click.
12
What is Class?
▪ A class is a prototype that defines the variables and the methods
common to all objects of a certain kind.
▪ A class is an entity that helps the programmer to define a new
complex data type.
➢An object is an instance of a class.
➢A class defines the data and behavior of objects.
➢E.g. Apple, Orange and banana are members of the fruit class.
13
Introduction to PHP Syntax
▪ PHP has quality easy syntax. If you are familiar with any c-type
language
▪ It has all the same structures that you are familiar with other
programming languages
▪ PHP is designed to output to browser, but it is possible to do also
CLI apps
14
Variables
▪ Variables in PHP are represented by a dollar sign ($).
▪ PHP supports nine main types:
▪ boolean
▪ integer
▪ float
▪ double
▪ string
▪ array
▪ object
▪ resource
▪ NULL
▪ Case-sensitivity
▪ Start with letter or _
▪ After that you can have numbers, letters and _
15
Booleans
▪ Simple Type
▪ A boolean expresses a truth value. It can be either TRUE or False
(case-insensitive).
16
Integers
▪ An integer is a number of the Set Z = { … , -2 , -1 , 0 , 1 , 2 , … }
▪ Integers can be specified in decimal (base 10), hexadecimal
(base 16), octal (base 8) or binary (base 2) notation, optionally
preceded by a sign ( - or + ).
17
Array
▪ An array in PHP is actually an ordered map. A map is a type that
associates values to keys.
▪ This type is optimized for several different uses:
▪ Array
▪ List (vector)
▪ Hash table
▪ Dictionary
▪ Collection
▪ Stack
▪ Queue
▪ …
18
NULL
▪ The special Null value represents a variable with no value.
▪ NULL is the only possible value of type null.
▪ A variable is considered to be null if:
▪ It has been assigned the constant NULL.
▪ It has not been set to any value yet.
▪ It has been unset()
19
Functions
▪ A function may be defined using syntax such as the following:
▪ Any valid PHP code may appear inside a function, even other
functions.
20
Class in PHP
▪ Basic class definitions begin with the keyword class, followed by
a class name
▪ Then, followed by a pair of curly braces which enclose the
definitions of the properties and methods belonging to the class.
21
Object in PHP
▪ Instance of class
22
Namespace
▪ Provide a way in which to group related classes, functions,
constants and others.
▪ An abstract concept in many places.
▪ In PHP world, namespaces are designed to solve two problems:
▪ Name collisions between code you create
▪ Improving readability of source code (Ability to alias)
23
Composer
▪ Composer is a tool for dependency management in PHP. It allows
you to declare the libraries your project depends on and it will
manage (install/update) them for you.
▪ Use:
▪ Install Composer
▪ In root of your project, Create a text file (JSON File) – composer.json
▪ Require all libraries you want to use it
▪ Composer install
24
What is Framework?
▪ An application framework is a software library that provides a
fundamental structure to support the development
of applications for a specific environment.
▪ In computer systems, a framework is often a layered structure
indicating what kind of programs can or should be built and how
they would interrelate.
▪ A PHP Framework is a basic platform that allows us to develop
web applications. In other words, it provides structure. By using
a PHP Framework, you will end up saving loads of time, stopping
the need to produce repetitive code, and you'll be able to build
applications rapidly (RAD).
25
MVC: Model-View-Controller
▪ Model–View–Controller (MVC) is a software design pattern for
implementing user interfaces on computers.
▪ It divides a given application into three interconnected parts in
order to separate internal representations of information from the
ways that information is presented to and accepted from the user.
▪ Popular programming languages like Java, C#, Ruby, PHP and
others have popular MVC frameworks.
26
Laravel
▪ Laravel is a free, open-source PHP web framework created by
Taylor Otwell.
▪ Intended for the development of web applications following
the model–view–controller (MVC) architectural pattern.
➢As of March 2015, Laravel is regarded as one of the most
popular PHP frameworks, together
with Symfony2, Nette, CodeIgniter, Yii2 and other frameworks.
27
Laravel Requirements:
▪ The Laravel framework has a few system requirements:
▪ PHP >= 5.6.4
▪ OpenSSL PHP Extension
▪ PDO PHP Extension
▪ Mbstring PHP Extension
▪ Tokenizer PHP Extension
▪ XML PHP Extension
Laravel utilizes Composer to manage its dependencies. So, before
using Laravel, make sure you have Composer installed on your
machine.
28
Install Laravel
▪ First, download the Laravel installer using Composer:
▪ composer global require "laravel/installer“
▪ laravel new blog
29

More Related Content

What's hot (20)

Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.js
TechMagic
 
Angular Lifecycle Hooks
Angular Lifecycle HooksAngular Lifecycle Hooks
Angular Lifecycle Hooks
Squash Apps Pvt Ltd
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Vikash Singh
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
Serhat Can
 
Springboot Microservices
Springboot MicroservicesSpringboot Microservices
Springboot Microservices
NexThoughts Technologies
 
Angular overview
Angular overviewAngular overview
Angular overview
Thanvilahari
 
SELENIUM PPT.pdf
SELENIUM PPT.pdfSELENIUM PPT.pdf
SELENIUM PPT.pdf
RebelSnowball
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Edureka!
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET Core
Avanade Nederland
 
Vue.js
Vue.jsVue.js
Vue.js
Jadson Santos
 
An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
Pagepro
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introduction
Rasheed Waraich
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
Mayank Panchal
 
Asp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity FrameworkAsp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity Framework
Shravan A
 
JavaScript Promises
JavaScript PromisesJavaScript Promises
JavaScript Promises
L&T Technology Services Limited
 
VueJS Introduction
VueJS IntroductionVueJS Introduction
VueJS Introduction
David Ličen
 
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Edureka!
 
Express js
Express jsExpress js
Express js
Manav Prasad
 
Angular Directives
Angular DirectivesAngular Directives
Angular Directives
iFour Technolab Pvt. Ltd.
 
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
Edureka!
 
Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.js
TechMagic
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Vikash Singh
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
Serhat Can
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Edureka!
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET Core
Avanade Nederland
 
An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
Pagepro
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introduction
Rasheed Waraich
 
Asp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity FrameworkAsp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity Framework
Shravan A
 
VueJS Introduction
VueJS IntroductionVueJS Introduction
VueJS Introduction
David Ličen
 
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Edureka!
 
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
Edureka!
 

Similar to Object Oriented Programming with Laravel - Session 1 (20)

Programming paradigm and web programming
Programming paradigm and web programmingProgramming paradigm and web programming
Programming paradigm and web programming
Mohammad Kamrul Hasan
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1
ADARSH BHATT
 
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdfTop 8 Powerful Tools Developers Use for Laravel Web Development.pdf
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
MoonTechnolabsPvtLtd
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
burasyacob012
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)
Dastan Kamaran
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)
Dastan Kamaran
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
Eric Johnson
 
PHP TRAINING
PHP TRAININGPHP TRAINING
PHP TRAINING
gurjinderbains
 
Chapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptx
Chapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptxChapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptx
Chapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptx
berihun18
 
Exploring PHP's Built-in Functions
Exploring PHP's Built-in FunctionsExploring PHP's Built-in Functions
Exploring PHP's Built-in Functions
Emma Thompson
 
Programming language
Programming languageProgramming language
Programming language
MalayKalavadia
 
Node.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdfNode.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdf
Mindfire LLC
 
Essential Guide To Php For All Levels O Adeolu
Essential Guide To Php For All Levels O AdeoluEssential Guide To Php For All Levels O Adeolu
Essential Guide To Php For All Levels O Adeolu
glouxrashiq71
 
Intro to programming and intro to java netbean.pdf
Intro to programming and intro to java netbean.pdfIntro to programming and intro to java netbean.pdf
Intro to programming and intro to java netbean.pdf
ErwinButchNicolas1
 
Web programming using PHP and Introduction with sample codes
Web programming using PHP and Introduction with sample codesWeb programming using PHP and Introduction with sample codes
Web programming using PHP and Introduction with sample codes
DivyaKS12
 
Top 10 php frameworks in 2021
Top 10 php frameworks in 2021Top 10 php frameworks in 2021
Top 10 php frameworks in 2021
MaryamAnwar10
 
PHP Jump Start
PHP Jump StartPHP Jump Start
PHP Jump Start
Haim Michael
 
Laravel level 0 (introduction)
Laravel level 0 (introduction)Laravel level 0 (introduction)
Laravel level 0 (introduction)
Kriangkrai Chaonithi
 
DOT NET TRaining
DOT NET TRainingDOT NET TRaining
DOT NET TRaining
sunil kumar
 
OOP Java
OOP JavaOOP Java
OOP Java
Saif Kassim
 
Programming paradigm and web programming
Programming paradigm and web programmingProgramming paradigm and web programming
Programming paradigm and web programming
Mohammad Kamrul Hasan
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1
ADARSH BHATT
 
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdfTop 8 Powerful Tools Developers Use for Laravel Web Development.pdf
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
MoonTechnolabsPvtLtd
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
burasyacob012
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)
Dastan Kamaran
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)
Dastan Kamaran
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
Eric Johnson
 
Chapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptx
Chapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptxChapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptx
Chapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptx
berihun18
 
Exploring PHP's Built-in Functions
Exploring PHP's Built-in FunctionsExploring PHP's Built-in Functions
Exploring PHP's Built-in Functions
Emma Thompson
 
Node.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdfNode.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdf
Mindfire LLC
 
Essential Guide To Php For All Levels O Adeolu
Essential Guide To Php For All Levels O AdeoluEssential Guide To Php For All Levels O Adeolu
Essential Guide To Php For All Levels O Adeolu
glouxrashiq71
 
Intro to programming and intro to java netbean.pdf
Intro to programming and intro to java netbean.pdfIntro to programming and intro to java netbean.pdf
Intro to programming and intro to java netbean.pdf
ErwinButchNicolas1
 
Web programming using PHP and Introduction with sample codes
Web programming using PHP and Introduction with sample codesWeb programming using PHP and Introduction with sample codes
Web programming using PHP and Introduction with sample codes
DivyaKS12
 
Top 10 php frameworks in 2021
Top 10 php frameworks in 2021Top 10 php frameworks in 2021
Top 10 php frameworks in 2021
MaryamAnwar10
 
DOT NET TRaining
DOT NET TRainingDOT NET TRaining
DOT NET TRaining
sunil kumar
 
Ad

More from Shahrzad Peyman (13)

Web Design & Development - Session 9
Web Design & Development - Session 9Web Design & Development - Session 9
Web Design & Development - Session 9
Shahrzad Peyman
 
Web Design & Development - Session 8
Web Design & Development - Session 8Web Design & Development - Session 8
Web Design & Development - Session 8
Shahrzad Peyman
 
Web Design & Development - Session 7
Web Design & Development - Session 7Web Design & Development - Session 7
Web Design & Development - Session 7
Shahrzad Peyman
 
Web Design & Development - Session 6
Web Design & Development - Session 6Web Design & Development - Session 6
Web Design & Development - Session 6
Shahrzad Peyman
 
Web Design & Development - Session 4
Web Design & Development - Session 4Web Design & Development - Session 4
Web Design & Development - Session 4
Shahrzad Peyman
 
Web Design & Development - Session 3
Web Design & Development - Session 3Web Design & Development - Session 3
Web Design & Development - Session 3
Shahrzad Peyman
 
Web Design & Development - Session 2
Web Design & Development - Session 2Web Design & Development - Session 2
Web Design & Development - Session 2
Shahrzad Peyman
 
Web Design & Development - Session 1
Web Design & Development - Session 1Web Design & Development - Session 1
Web Design & Development - Session 1
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 6
Object Oriented Programming with Laravel - Session 6Object Oriented Programming with Laravel - Session 6
Object Oriented Programming with Laravel - Session 6
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 5
Object Oriented Programming with Laravel - Session 5Object Oriented Programming with Laravel - Session 5
Object Oriented Programming with Laravel - Session 5
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 4
Object Oriented Programming with Laravel - Session 4Object Oriented Programming with Laravel - Session 4
Object Oriented Programming with Laravel - Session 4
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 3
Object Oriented Programming with Laravel - Session 3Object Oriented Programming with Laravel - Session 3
Object Oriented Programming with Laravel - Session 3
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2
Shahrzad Peyman
 
Web Design & Development - Session 9
Web Design & Development - Session 9Web Design & Development - Session 9
Web Design & Development - Session 9
Shahrzad Peyman
 
Web Design & Development - Session 8
Web Design & Development - Session 8Web Design & Development - Session 8
Web Design & Development - Session 8
Shahrzad Peyman
 
Web Design & Development - Session 7
Web Design & Development - Session 7Web Design & Development - Session 7
Web Design & Development - Session 7
Shahrzad Peyman
 
Web Design & Development - Session 6
Web Design & Development - Session 6Web Design & Development - Session 6
Web Design & Development - Session 6
Shahrzad Peyman
 
Web Design & Development - Session 4
Web Design & Development - Session 4Web Design & Development - Session 4
Web Design & Development - Session 4
Shahrzad Peyman
 
Web Design & Development - Session 3
Web Design & Development - Session 3Web Design & Development - Session 3
Web Design & Development - Session 3
Shahrzad Peyman
 
Web Design & Development - Session 2
Web Design & Development - Session 2Web Design & Development - Session 2
Web Design & Development - Session 2
Shahrzad Peyman
 
Web Design & Development - Session 1
Web Design & Development - Session 1Web Design & Development - Session 1
Web Design & Development - Session 1
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 6
Object Oriented Programming with Laravel - Session 6Object Oriented Programming with Laravel - Session 6
Object Oriented Programming with Laravel - Session 6
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 5
Object Oriented Programming with Laravel - Session 5Object Oriented Programming with Laravel - Session 5
Object Oriented Programming with Laravel - Session 5
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 4
Object Oriented Programming with Laravel - Session 4Object Oriented Programming with Laravel - Session 4
Object Oriented Programming with Laravel - Session 4
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 3
Object Oriented Programming with Laravel - Session 3Object Oriented Programming with Laravel - Session 3
Object Oriented Programming with Laravel - Session 3
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2
Shahrzad Peyman
 
Ad

Recently uploaded (20)

Bonk coin airdrop_ Everything You Need to Know.pdf
Bonk coin airdrop_ Everything You Need to Know.pdfBonk coin airdrop_ Everything You Need to Know.pdf
Bonk coin airdrop_ Everything You Need to Know.pdf
Herond Labs
 
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
Insurance Tech Services
 
Essentials of Resource Planning in a Downturn
Essentials of Resource Planning in a DownturnEssentials of Resource Planning in a Downturn
Essentials of Resource Planning in a Downturn
OnePlan Solutions
 
AI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA TechnologiesAI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA Technologies
SandeepKS52
 
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Alluxio, Inc.
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdfdp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI SearchAgentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Maxim Salnikov
 
IBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - IntroductionIBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - Introduction
Gaurav Sharma
 
Maximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdfMaximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdf
Elena Mia
 
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
WSO2
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native BarcelonaOpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free DownloadWondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Puppy jhon
 
Porting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 WebinarPorting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 Webinar
ICS
 
Providing Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better DataProviding Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better Data
Safe Software
 
COBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM CertificateCOBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM Certificate
VICTOR MAESTRE RAMIREZ
 
14 Years of Developing nCine - An Open Source 2D Game Framework
14 Years of Developing nCine - An Open Source 2D Game Framework14 Years of Developing nCine - An Open Source 2D Game Framework
14 Years of Developing nCine - An Open Source 2D Game Framework
Angelo Theodorou
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Leveraging Foundation Models to Infer Intents
Leveraging Foundation Models to Infer IntentsLeveraging Foundation Models to Infer Intents
Leveraging Foundation Models to Infer Intents
Keheliya Gallaba
 
Agile Software Engineering Methodologies
Agile Software Engineering MethodologiesAgile Software Engineering Methodologies
Agile Software Engineering Methodologies
Gaurav Sharma
 
Software Testing & it’s types (DevOps)
Software  Testing & it’s  types (DevOps)Software  Testing & it’s  types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
Bonk coin airdrop_ Everything You Need to Know.pdf
Bonk coin airdrop_ Everything You Need to Know.pdfBonk coin airdrop_ Everything You Need to Know.pdf
Bonk coin airdrop_ Everything You Need to Know.pdf
Herond Labs
 
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
Insurance Tech Services
 
Essentials of Resource Planning in a Downturn
Essentials of Resource Planning in a DownturnEssentials of Resource Planning in a Downturn
Essentials of Resource Planning in a Downturn
OnePlan Solutions
 
AI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA TechnologiesAI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA Technologies
SandeepKS52
 
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Alluxio, Inc.
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdfdp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI SearchAgentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Maxim Salnikov
 
IBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - IntroductionIBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - Introduction
Gaurav Sharma
 
Maximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdfMaximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdf
Elena Mia
 
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
WSO2
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native BarcelonaOpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free DownloadWondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Puppy jhon
 
Porting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 WebinarPorting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 Webinar
ICS
 
Providing Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better DataProviding Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better Data
Safe Software
 
COBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM CertificateCOBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM Certificate
VICTOR MAESTRE RAMIREZ
 
14 Years of Developing nCine - An Open Source 2D Game Framework
14 Years of Developing nCine - An Open Source 2D Game Framework14 Years of Developing nCine - An Open Source 2D Game Framework
14 Years of Developing nCine - An Open Source 2D Game Framework
Angelo Theodorou
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Leveraging Foundation Models to Infer Intents
Leveraging Foundation Models to Infer IntentsLeveraging Foundation Models to Infer Intents
Leveraging Foundation Models to Infer Intents
Keheliya Gallaba
 
Agile Software Engineering Methodologies
Agile Software Engineering MethodologiesAgile Software Engineering Methodologies
Agile Software Engineering Methodologies
Gaurav Sharma
 
Software Testing & it’s types (DevOps)
Software  Testing & it’s  types (DevOps)Software  Testing & it’s  types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 

Object Oriented Programming with Laravel - Session 1

  • 2. Today’s Presentation ▪ What is PHP? ▪ Object Oriented Programming ▪ Introduction to PHP Syntax ▪ Composer ▪ Framework ▪ MVC ▪ Laravel 2
  • 3. What is PHP? ▪ PHP is a popular, general-purpose and server-side scripting language that is especially suited to web development. ▪ Commonly used to build web applications. ▪ PHP: Personal Home Page --- Php Hypertext Preprocessor ▪ PHP (Hypertext Preprocessor) was created by Rasmus Lerdorf in 1994. It is now developed and improved by a large team of people. ▪ http://www.php.net 3
  • 4. PHP History PHP2 1995 Added database support, file uploads, variables, arrays, recursive functions, conditionals, iterations, regular expression and etc. PHP3 1998 Added support of ODBC data sources, multiple platform support, email protocol, and new parser written by Zeev Suraski and Andi Gutmans. PHP4 2000 The parser was renamed the Zend Engine. Many security features were added. PHP5 2004 Adds Zend Engine 2 with object oriented programming, robust XML support, SOAP extension for interoperability with Web Services, SQLLite has been bundled with PHP. PHP7 2015 Revolution in PHP 4
  • 5. Scripting Language ▪ A scripting language is a programming language that employs a high-level construct to interpret and execute one command at a time. ▪ Interpreted at runtime 5
  • 6. Who Uses PHP? ▪ Yahoo! ▪ Facebook (HACK) ▪ Wikipedia ▪ 20+ million other domain names 6
  • 7. Which Tools Based on PHP? ▪ Wordpress (Blog engine) ▪ Drupal (CMS) ▪ Slack (Chat Service) ▪ Joomla (CMS) ➢As of January 2013, PHP was used in more than 240 million websites (39% of those sampled) and was installed on 2.1 million web servers. 7
  • 8. Why I Choose PHP? ▪ Cost nothing, it is free to download and use. ▪ Open source ▪ Runs on different platforms ▪ Codes and solutions are easily available ▪ Lots and lots of knowledge and documentation ▪ Speed of development 8
  • 10. Object-Oriented Programming What is Object-Oriented Programming (OOP)? Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects". So, Objects are key to understanding object-oriented technology. 10
  • 11. What is Object? ❖Many examples of real-world objects ▪ your Book, your PC, your Mobile, your Computer mouse and so on. ❖Real-world objects share two characteristics: ▪ State ▪ Behavior ❖Software Objects ▪ Modeled after real-world objects. ▪ Maintains its states in variables or attributes. ▪ Implements its behaviors with methods. 11
  • 12. Objects ▪ E.g. A Computer Mouse is a real-world Object. Its states would be its color, size and brand name and its behaviors would be left- click, right-click and middle click. ▪ Software object that modeled your real-world computer mouse. ▪ Have variables(attributes) that indicated the computer mouse’s current states: ▪ Its color is black. ▪ Its size is medium. ▪ Its brand name is Genius. ▪ Have methods that indicated the computer mouse’s current behaviors like left-click, right-click and middle click. 12
  • 13. What is Class? ▪ A class is a prototype that defines the variables and the methods common to all objects of a certain kind. ▪ A class is an entity that helps the programmer to define a new complex data type. ➢An object is an instance of a class. ➢A class defines the data and behavior of objects. ➢E.g. Apple, Orange and banana are members of the fruit class. 13
  • 14. Introduction to PHP Syntax ▪ PHP has quality easy syntax. If you are familiar with any c-type language ▪ It has all the same structures that you are familiar with other programming languages ▪ PHP is designed to output to browser, but it is possible to do also CLI apps 14
  • 15. Variables ▪ Variables in PHP are represented by a dollar sign ($). ▪ PHP supports nine main types: ▪ boolean ▪ integer ▪ float ▪ double ▪ string ▪ array ▪ object ▪ resource ▪ NULL ▪ Case-sensitivity ▪ Start with letter or _ ▪ After that you can have numbers, letters and _ 15
  • 16. Booleans ▪ Simple Type ▪ A boolean expresses a truth value. It can be either TRUE or False (case-insensitive). 16
  • 17. Integers ▪ An integer is a number of the Set Z = { … , -2 , -1 , 0 , 1 , 2 , … } ▪ Integers can be specified in decimal (base 10), hexadecimal (base 16), octal (base 8) or binary (base 2) notation, optionally preceded by a sign ( - or + ). 17
  • 18. Array ▪ An array in PHP is actually an ordered map. A map is a type that associates values to keys. ▪ This type is optimized for several different uses: ▪ Array ▪ List (vector) ▪ Hash table ▪ Dictionary ▪ Collection ▪ Stack ▪ Queue ▪ … 18
  • 19. NULL ▪ The special Null value represents a variable with no value. ▪ NULL is the only possible value of type null. ▪ A variable is considered to be null if: ▪ It has been assigned the constant NULL. ▪ It has not been set to any value yet. ▪ It has been unset() 19
  • 20. Functions ▪ A function may be defined using syntax such as the following: ▪ Any valid PHP code may appear inside a function, even other functions. 20
  • 21. Class in PHP ▪ Basic class definitions begin with the keyword class, followed by a class name ▪ Then, followed by a pair of curly braces which enclose the definitions of the properties and methods belonging to the class. 21
  • 22. Object in PHP ▪ Instance of class 22
  • 23. Namespace ▪ Provide a way in which to group related classes, functions, constants and others. ▪ An abstract concept in many places. ▪ In PHP world, namespaces are designed to solve two problems: ▪ Name collisions between code you create ▪ Improving readability of source code (Ability to alias) 23
  • 24. Composer ▪ Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. ▪ Use: ▪ Install Composer ▪ In root of your project, Create a text file (JSON File) – composer.json ▪ Require all libraries you want to use it ▪ Composer install 24
  • 25. What is Framework? ▪ An application framework is a software library that provides a fundamental structure to support the development of applications for a specific environment. ▪ In computer systems, a framework is often a layered structure indicating what kind of programs can or should be built and how they would interrelate. ▪ A PHP Framework is a basic platform that allows us to develop web applications. In other words, it provides structure. By using a PHP Framework, you will end up saving loads of time, stopping the need to produce repetitive code, and you'll be able to build applications rapidly (RAD). 25
  • 26. MVC: Model-View-Controller ▪ Model–View–Controller (MVC) is a software design pattern for implementing user interfaces on computers. ▪ It divides a given application into three interconnected parts in order to separate internal representations of information from the ways that information is presented to and accepted from the user. ▪ Popular programming languages like Java, C#, Ruby, PHP and others have popular MVC frameworks. 26
  • 27. Laravel ▪ Laravel is a free, open-source PHP web framework created by Taylor Otwell. ▪ Intended for the development of web applications following the model–view–controller (MVC) architectural pattern. ➢As of March 2015, Laravel is regarded as one of the most popular PHP frameworks, together with Symfony2, Nette, CodeIgniter, Yii2 and other frameworks. 27
  • 28. Laravel Requirements: ▪ The Laravel framework has a few system requirements: ▪ PHP >= 5.6.4 ▪ OpenSSL PHP Extension ▪ PDO PHP Extension ▪ Mbstring PHP Extension ▪ Tokenizer PHP Extension ▪ XML PHP Extension Laravel utilizes Composer to manage its dependencies. So, before using Laravel, make sure you have Composer installed on your machine. 28
  • 29. Install Laravel ▪ First, download the Laravel installer using Composer: ▪ composer global require "laravel/installer“ ▪ laravel new blog 29