SlideShare a Scribd company logo
1 of 32
Download to read offline
PHP Framework
Laravel
IS333 Web based information systems
By. Shaimaa Mohamed Galal
A quick Brief about the Laravel
PHP Framework
Laravel PHP framework is an open-source web application framework.
It is one of the most preferred frameworks for enterprise applications
because of its several outstanding features. They are:
01 02 03 04 05
Creative
independence
for web
developers
In-expensive
and
customizable
Easy and
safe data
migration
Highly
secure
Interactive
community
support
06
Easy testing
and execution
How to install Laravel for the 1st time
• Installation Guide:
https://www.youtube.com/watch?v=2qgS_MCvDfk&list=PPSV
• To install Laravel Framework you need to download:
1. XAMPP or WAMP
XAMPP is a free and open-source cross-platform web server solution
stack package
2. Composer
3. Visual Studio Code or PHP Storm (requires a license)
4. Install Laravel Framework extension to Visual Studio Code or
PHP Storm
Composer Tool
Dependency management
• It manages them on a per-project basis, installing them in a
directory (e.g. vendor) inside your project.
• By default, it does not install anything globally. Thus, it is a
dependency manager.
• It does however support a "global" project for convenience via
the global command.
• 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.
Composer Tool
• Suppose:
1. You have a project that depends on a number of
libraries.
2. Some of those libraries depend on other libraries.
• Composer:
1. Enables you to declare the libraries you depend on.
2. Finds out which versions of which packages can and
need to be installed, and installs them (meaning it
downloads them into your project).
3. You can update all your dependencies in one
command.
Visual Studio Code
• Visual Studio Code is not the same as Visual Studio IDE.
• A lightweight powerful
source code editor.
• Runs on Windows,
macOS and Linux.
• It comes with built-in
support for JavaScript,
TypeScript and Node.js
• Has extensions for
other languages and
runtimes (such as C++,
C#, Java, Python, PHP,
Go, .NET)
Visual Studio Code
• Open VS terminal and use the following two commands
• Open terminal and choose a folder then write the following commands
1. Install the Laravel Framework Extension
• Choose a Folder and create a new application using :
• Use Serve command this will make your app accessible through
http://127.0.0.1:8000/ by default
composer global require laravel/installer
laravel new example-app
php artisan serve
Features
Artisan
● An artisan is a built-in
tool for command line
in Laravel.
● Command line
interface.
● performs all the
repetitive
programming tasks
that most of the
developers want to
avoid to do manually.
Eloquent ORM
The Eloquent ORM
provides a simple PHP
Active Record
implementation.
Compared to all other
PHP frameworks, an
ORM is relatively
faster.
Another advantage of
Laravel is its object
Oriented libraries and
other pre-installed
libraries.
The best part of it is
easy-to-implement.
Libraries &
Modular
MVC Architecture
Support of Laravel
assures clarity of logic
and presentation.
MVC Architecture
Support
Without re-creating
the structure of
databases of the web
application, the
Laravel migration
system helps the PHP
developers to expand
the structure of the
database and to make
a change.
Migration system
for databases
Due to unit-testing,
many developers like
Laravel as it is capable
of running many tests
that gives surety that
the changes made by
developers on the
programme do not
break the web
application.
Unit-Testing
Laravel framework
provides powerful
web application
security.
All thanks to the
hashed and salted
password mechanism
that never save the
password as plain
text in the database.
Security
Directory Structure
• The default Laravel application
structure is intended to provide a great
starting point for both large and small
applications.
• You are free to organize your
application however you like.
• Laravel imposes almost no restrictions
on where any given class is located - as
long as Composer can autoload the
class.
Directory Structure
1. The App Directory
• Contains the core code of
your application.
• All of the classes in your
application will be in this
directory.
Directory Structure
2. The bootstrap Directory (Autoloading)
• Contains the app.php file that loads
and initialize the app.
• Houses a cache directory which
contains framework generated files for
performance optimization such as the
route and services cache files.
• You should not typically need to
modify any files within this directory.
Directory Structure
2. The bootstrap Directory (Autoloading)
Inside the bootstrap folder you will find a
few files:
• autoload.php - loads and includes
composer so any packages are loaded.
• services.php - stores the providers in the
application to load the system quicker.
• app.php - loads and initializes the app.
Directory Structure
3. The config Directory
• The config directory, as the name
implies, contains all of your
application's configuration files.
• Include configurations such as
database, mail, sessions, and
authorizations.
Directory Structure
4. The database Directory
• Contains your database
migrations, model factories, and
seeds.
• You may also use this directory to
hold an SQLite database files.
• Contains seedings (test data in
DB).
Directory Structure
5. The public Directory
• Contains frontend related files.
• Includes the index.php file, which
is the entry point for all requests
entering your application and
configures autoloading.
• This directory also houses your
assets such as images, JavaScript,
and CSS.
Directory Structure
6. The resouces Directory
• Contains your views as well as
your raw using Blade template.
• Un-compiled assets such as CSS or
JavaScript.
• Localization files for
multilanguages.
Directory Structure
7. The routes Directory
• Routing is what happens when an
application determines which
controllers and actions are
executed based on the URL
requested.
• It is how the framework gets from
http://localhost/users/list.html to
the Users controller and the list()
action.
Directory Structure
8. The storage Directory
• contains your logs, compiled
Blade templates, file based
sessions, file caches, and other
files generated by the framework.
• Can be used to store any files
generated by your application.
Directory Structure
8. The tests Directory
• Contains your automated tests.
• Uses PHPUnit unit tests and
feature tests are provided out of
the box.
• Each test class should be suffixed
with the word Test.
• You may run your tests using the
phpunit or
php vendor/bin/phpunit commands.
Directory Structure
9. The vendor Directory
The vendor directory contains your
Composer dependencies.
Run First Application Demo
Adding Code Snippet is Fun
Adding Code Snippet
• Code snippets are templates that make it
easier to enter repeating code patterns,
such as loops or conditional-statements.
• In Visual Studio Code, snippets appear in
IntelliSense (Ctrl+Space) mixed with other
suggestions, as well as in a dedicated
snippet picker
Install snippets from the marketplace
Tutorial
• Laravel Project Structure (Arabic Playlist)
https://youtu.be/lyVzDn30hQc
Installation guide
https://www.youtube.com/watch?v=2qgS_MC
vDfk&list=PPSV

More Related Content

Similar to Lecture11_LaravelGetStarted_SPring2023.pdf

UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basics
Ulrich Krause
 
Intro to Microsoft.NET
Intro to Microsoft.NET Intro to Microsoft.NET
Intro to Microsoft.NET
rchakra
 
introduction to web programming using PHP
introduction to web programming using PHPintroduction to web programming using PHP
introduction to web programming using PHP
vishnupriyapm4
 

Similar to Lecture11_LaravelGetStarted_SPring2023.pdf (20)

Prominent Back-end frameworks to consider in 2022!
Prominent Back-end frameworks to consider in 2022!Prominent Back-end frameworks to consider in 2022!
Prominent Back-end frameworks to consider in 2022!
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basics
 
Laravel Presentation
Laravel PresentationLaravel Presentation
Laravel Presentation
 
Introduction to Spring & Spring BootFramework
Introduction to Spring  & Spring BootFrameworkIntroduction to Spring  & Spring BootFramework
Introduction to Spring & Spring BootFramework
 
Laravel (8) php_framework_handbook__start_from_zer_18604872_(z-lib.org)
Laravel (8) php_framework_handbook__start_from_zer_18604872_(z-lib.org)Laravel (8) php_framework_handbook__start_from_zer_18604872_(z-lib.org)
Laravel (8) php_framework_handbook__start_from_zer_18604872_(z-lib.org)
 
Top 10 php frameworks in 2021
Top 10 php frameworks in 2021Top 10 php frameworks in 2021
Top 10 php frameworks in 2021
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the Basics
 
Intro to Microsoft.NET
Intro to Microsoft.NET Intro to Microsoft.NET
Intro to Microsoft.NET
 
Laravel : A Fastest Growing Kid
Laravel : A Fastest Growing KidLaravel : A Fastest Growing Kid
Laravel : A Fastest Growing Kid
 
What-is-Laravel-23-August-2017.pptx
What-is-Laravel-23-August-2017.pptxWhat-is-Laravel-23-August-2017.pptx
What-is-Laravel-23-August-2017.pptx
 
Drupal 7
Drupal 7Drupal 7
Drupal 7
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
 
Php Web Frameworks
Php Web FrameworksPhp Web Frameworks
Php Web Frameworks
 
Java basics notes
Java basics notesJava basics notes
Java basics notes
 
Laravel 4 presentation
Laravel 4 presentationLaravel 4 presentation
Laravel 4 presentation
 
introduction to web programming using PHP
introduction to web programming using PHPintroduction to web programming using PHP
introduction to web programming using PHP
 
How to Install Laravel 5.7
How to Install Laravel 5.7How to Install Laravel 5.7
How to Install Laravel 5.7
 
Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVA
 
Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.
 

More from ShaimaaMohamedGalal (10)

Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Data mining ..... Association rule mining
Data mining ..... Association rule miningData mining ..... Association rule mining
Data mining ..... Association rule mining
 
Lecture 0 - Advanced DB.pdf
Lecture 0 - Advanced DB.pdfLecture 0 - Advanced DB.pdf
Lecture 0 - Advanced DB.pdf
 
Lecture8_AdvancedPHP(Continue)-APICalls_SPring2023.pdf
Lecture8_AdvancedPHP(Continue)-APICalls_SPring2023.pdfLecture8_AdvancedPHP(Continue)-APICalls_SPring2023.pdf
Lecture8_AdvancedPHP(Continue)-APICalls_SPring2023.pdf
 
Lecture15_LaravelGetStarted_SPring2023.pdf
Lecture15_LaravelGetStarted_SPring2023.pdfLecture15_LaravelGetStarted_SPring2023.pdf
Lecture15_LaravelGetStarted_SPring2023.pdf
 
Lecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdfLecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdf
 
Lecture9_OOPHP_SPring2023.pptx
Lecture9_OOPHP_SPring2023.pptxLecture9_OOPHP_SPring2023.pptx
Lecture9_OOPHP_SPring2023.pptx
 
2. Lecture2_NOSQL_KeyValue.ppt
2. Lecture2_NOSQL_KeyValue.ppt2. Lecture2_NOSQL_KeyValue.ppt
2. Lecture2_NOSQL_KeyValue.ppt
 
1. Lecture1_NOSQL_Introduction.pdf
1. Lecture1_NOSQL_Introduction.pdf1. Lecture1_NOSQL_Introduction.pdf
1. Lecture1_NOSQL_Introduction.pdf
 
Lecture3.ppt
Lecture3.pptLecture3.ppt
Lecture3.ppt
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

Lecture11_LaravelGetStarted_SPring2023.pdf

  • 1. PHP Framework Laravel IS333 Web based information systems By. Shaimaa Mohamed Galal
  • 2. A quick Brief about the Laravel PHP Framework Laravel PHP framework is an open-source web application framework. It is one of the most preferred frameworks for enterprise applications because of its several outstanding features. They are: 01 02 03 04 05 Creative independence for web developers In-expensive and customizable Easy and safe data migration Highly secure Interactive community support 06 Easy testing and execution
  • 3. How to install Laravel for the 1st time • Installation Guide: https://www.youtube.com/watch?v=2qgS_MCvDfk&list=PPSV • To install Laravel Framework you need to download: 1. XAMPP or WAMP XAMPP is a free and open-source cross-platform web server solution stack package 2. Composer 3. Visual Studio Code or PHP Storm (requires a license) 4. Install Laravel Framework extension to Visual Studio Code or PHP Storm
  • 4. Composer Tool Dependency management • It manages them on a per-project basis, installing them in a directory (e.g. vendor) inside your project. • By default, it does not install anything globally. Thus, it is a dependency manager. • It does however support a "global" project for convenience via the global command. • 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.
  • 5. Composer Tool • Suppose: 1. You have a project that depends on a number of libraries. 2. Some of those libraries depend on other libraries. • Composer: 1. Enables you to declare the libraries you depend on. 2. Finds out which versions of which packages can and need to be installed, and installs them (meaning it downloads them into your project). 3. You can update all your dependencies in one command.
  • 6. Visual Studio Code • Visual Studio Code is not the same as Visual Studio IDE. • A lightweight powerful source code editor. • Runs on Windows, macOS and Linux. • It comes with built-in support for JavaScript, TypeScript and Node.js • Has extensions for other languages and runtimes (such as C++, C#, Java, Python, PHP, Go, .NET)
  • 7. Visual Studio Code • Open VS terminal and use the following two commands • Open terminal and choose a folder then write the following commands 1. Install the Laravel Framework Extension • Choose a Folder and create a new application using : • Use Serve command this will make your app accessible through http://127.0.0.1:8000/ by default composer global require laravel/installer laravel new example-app php artisan serve
  • 9. Artisan ● An artisan is a built-in tool for command line in Laravel. ● Command line interface. ● performs all the repetitive programming tasks that most of the developers want to avoid to do manually.
  • 10. Eloquent ORM The Eloquent ORM provides a simple PHP Active Record implementation. Compared to all other PHP frameworks, an ORM is relatively faster.
  • 11. Another advantage of Laravel is its object Oriented libraries and other pre-installed libraries. The best part of it is easy-to-implement. Libraries & Modular
  • 12. MVC Architecture Support of Laravel assures clarity of logic and presentation. MVC Architecture Support
  • 13. Without re-creating the structure of databases of the web application, the Laravel migration system helps the PHP developers to expand the structure of the database and to make a change. Migration system for databases
  • 14. Due to unit-testing, many developers like Laravel as it is capable of running many tests that gives surety that the changes made by developers on the programme do not break the web application. Unit-Testing
  • 15. Laravel framework provides powerful web application security. All thanks to the hashed and salted password mechanism that never save the password as plain text in the database. Security
  • 16. Directory Structure • The default Laravel application structure is intended to provide a great starting point for both large and small applications. • You are free to organize your application however you like. • Laravel imposes almost no restrictions on where any given class is located - as long as Composer can autoload the class.
  • 17. Directory Structure 1. The App Directory • Contains the core code of your application. • All of the classes in your application will be in this directory.
  • 18. Directory Structure 2. The bootstrap Directory (Autoloading) • Contains the app.php file that loads and initialize the app. • Houses a cache directory which contains framework generated files for performance optimization such as the route and services cache files. • You should not typically need to modify any files within this directory.
  • 19. Directory Structure 2. The bootstrap Directory (Autoloading) Inside the bootstrap folder you will find a few files: • autoload.php - loads and includes composer so any packages are loaded. • services.php - stores the providers in the application to load the system quicker. • app.php - loads and initializes the app.
  • 20. Directory Structure 3. The config Directory • The config directory, as the name implies, contains all of your application's configuration files. • Include configurations such as database, mail, sessions, and authorizations.
  • 21. Directory Structure 4. The database Directory • Contains your database migrations, model factories, and seeds. • You may also use this directory to hold an SQLite database files. • Contains seedings (test data in DB).
  • 22. Directory Structure 5. The public Directory • Contains frontend related files. • Includes the index.php file, which is the entry point for all requests entering your application and configures autoloading. • This directory also houses your assets such as images, JavaScript, and CSS.
  • 23. Directory Structure 6. The resouces Directory • Contains your views as well as your raw using Blade template. • Un-compiled assets such as CSS or JavaScript. • Localization files for multilanguages.
  • 24. Directory Structure 7. The routes Directory • Routing is what happens when an application determines which controllers and actions are executed based on the URL requested. • It is how the framework gets from http://localhost/users/list.html to the Users controller and the list() action.
  • 25. Directory Structure 8. The storage Directory • contains your logs, compiled Blade templates, file based sessions, file caches, and other files generated by the framework. • Can be used to store any files generated by your application.
  • 26. Directory Structure 8. The tests Directory • Contains your automated tests. • Uses PHPUnit unit tests and feature tests are provided out of the box. • Each test class should be suffixed with the word Test. • You may run your tests using the phpunit or php vendor/bin/phpunit commands.
  • 27. Directory Structure 9. The vendor Directory The vendor directory contains your Composer dependencies.
  • 30. Adding Code Snippet • Code snippets are templates that make it easier to enter repeating code patterns, such as loops or conditional-statements. • In Visual Studio Code, snippets appear in IntelliSense (Ctrl+Space) mixed with other suggestions, as well as in a dedicated snippet picker
  • 31. Install snippets from the marketplace
  • 32. Tutorial • Laravel Project Structure (Arabic Playlist) https://youtu.be/lyVzDn30hQc Installation guide https://www.youtube.com/watch?v=2qgS_MC vDfk&list=PPSV