SlideShare a Scribd company logo
Laravel 5
The PHP Framework ForWebArtisans
What is Laravel?
 PHP Framework for Web Artisans
 Built on top of Symfony2 Components
 Like any framework, provides services and libraries to make
interacting with web requests and other services
Most Popular PHP Framework
on Github
Stars
0
4000
16000
Laravel Symfony CodeIgniter Zend Slim
486950715313
5584
9517
12000
9854
8000
15329
CakePHP
CodeIgniter
Yii2
CakePHP Yii2Laravel
Zend
Symfony
Slim
March, 23 2015 https://github.com/search?l=php&o=desc&q=stars%3A%3E1&s=stars&type=Repositories
• Initial Release
• Languange
• Architecture
• License
: June 2011 (latest: 5.0.16 March 14, 2015)
: PHP (5.4+)
: MVC
: MIT
http://en.wikipedia.org/wiki/Laravel
Details
Where to start from?
Laravel is very flexible framework. There are at least 3
options how to create new project:
- via laravel installer
- via composer
- clone from github
Via Laravel installer
This will download laravel installer via composer
- composer global require "laravel/installer=~1.1"
When installer added this simple command will create app
- laravel new <app name>
* Do not forget to add ~/.composer/vendor/bin to your PATH variable in ~/.bashrc
Other options
Via composer
- composer create-project laravel/laravel your-project-name
Get from GitHub
- https://github.com/laravel/laravel
- And then in the project dir run “composer install” to get all needed
packages
Laravel and Composer
Using composer in Laravel you can
- Add/remove/update packages
- Dump autoload file and generate new one
- Update laravel version
Overall
Architecture
http://tech.knolskape.com/10-‐quick-‐tips-‐to-‐get-‐better-‐at-‐laravel/
What’s New?
In laravel 5
What’s New?
• New Folder Structure
• Contracts (interface)
• Route Middleware
• Controller Method Injection
• Laravel Scheduler
• Tinker / Psysh
• DotEnv (.env)
• Form Requests
• Symfony VarDumper
middleware
tinker
method injection
dd($foo) var_dump($foo)
Print_r($foo)
Laravel directory structure
The app directory, as you might expect, contains the core code of your application.
The config directory, as the name implies, contains all of your application's configuration files.
The database folder contains your database migration and seeds.
The public directory contains the front controller and your assets (images, JavaScript, CSS, etc.).
The app/storage directory contains compiled Blade templates, file based sessions, file caches, and
other files generated by the framework.
The tests directory contains your automated tests.
The vendor directory contains your Composer dependencies.
The app/model directory contains your model
The app/http/controllers directory contains your model
...
Magic Artisan
- Is located in Laravel project root directory
- Basically is a php script which performs all actions in
Laravel for example:
- Manage migrations
- Check application routes
- tinker
- Create Artisan commands
- Run database seeds
Full list is available with “php artisan list”
Artisan CLI
Artisan commands
Artisan commands usually are some scripts launched from
command line or with cron. For example you need to have
daily export of your orders - write a command and run it
with cron.
- They accept options and
arguments
- Have pretty output if
needed
- Interactive (can ask
password/question)
Laravel Environmental Configuration
 After installing Laravel and setting up project, the first thing we need to do
is Generating Application key ( php artisan key:generate )
 Laravel provides facility to run your application in different environment like
testing, production,etc.
 You can configure the environment of your application in the .env file of the
root directory of your application.
 If you have installed Laravel using composer, this file will automatically be
created.otherwise, you can simply rename the .env.example file to .env file
Environmental Configuration (Continue)
 This is a sample .env
file
 you can both keep
configuration/environ
ment variables in .env
or in a config/ file
 Next we’ll see how to
keep config in config/
file
Laravel Config
Laravel uses config files with arrays in it to
store different configurations. database.php ->
Location: /config
To get config value simply follow dot notation
Config::get(‘<filename>.key1.key2.key3’);
Can also pass default value on not found
Config::get(‘key’, 123);
Laravel actively uses php namespaces to keep classnames
short and possibility to use same class names for different
components.
For example all Admin functionality under Admin
namespace.
Laravel and namespaces
So Laravel is MVC framework meaning
we have folder for controllers, views and
models by default, no need to create
them.
Guess there’s no need to explain MVC
pattern.
Laravel MVC
Features
In Laravel
Features
• Artisan CLI
• Routing
• Middleware
• Resourceful Controllers
• Eloquent ORM (Object-‐Relational Mapping)
• Blade Templating
• Migrations and Database Seeding
http://www.webdesignermag.co.uk/laravel-‐a-‐modern-‐php-‐framework/
Features
• Artisan CLI
• Routing
• Middleware
• Resourceful Controllers
• Eloquent ORM (Object-‐Relational Mapping)
• Blade Templating
• Migrations and Database Seeding
http://www.webdesignermag.co.uk/laravel-‐a-‐modern-‐php-‐framework/
Features
• Artisan CLI
• Routing
• Middleware
• Resourceful Controllers
• Eloquent ORM (Object-‐Relational Mapping)
• Blade Templating
• Migrations and Database Seeding
http://www.webdesignermag.co.uk/laravel-‐a-‐modern-‐php-‐framework/
Features
• Artisan CLI
• Routing
• Middleware
• Resourceful Controllers
• Eloquent ORM (Object-‐Relational Mapping)
• Blade Templating
• Migrations and Database Seeding
http://www.webdesignermag.co.uk/laravel-‐a-‐modern-‐php-‐framework/
 There’s one main Controller class which
all controllers should extend.
 By default Laravel has BaseController
(extends from Controller) and
HomeController (extends from
BaseController)
Laravel controllers
Laravel controllers
More advanced
example.
Responds only to get
method and returns
rendered view
Responds to post
method, and returns
redirect to next logical
action
Type-hint any dependency
in controller constructors
Type-hint any dependency in
Controller methods
Features
• Artisan CLI
• Routing
• Middleware
• Resourceful Controllers
• Eloquent ORM (Object-‐Relational Mapping)
• Blade Templating
• Migrations and Database Seeding
http://www.webdesignermag.co.uk/laravel-‐a-‐modern-‐php-‐framework/
Blade
Laravel migrations
 Interaction with migrations is
happening through artisan commands.
 Each migration has two functions up and down
to migrate and rollback
Features
• Artisan CLI
• Routing
• Middleware
• Resourceful Controllers
• Migrations and Database Seeding
• Eloquent ORM (Object-‐Relational Mapping)
• Blade Templating
http://www.webdesignermag.co.uk/laravel-‐a-‐modern-‐php-‐framework/
Laravel migrations
 This is how
basic migration
looks like
DB seeds
 Seeds are used to insert predefined data in
tables so there is something to start from for
example on development environment we can
create test users, test products and so on.
Features
• Artisan CLI
• Routing
• Middleware
• Resourceful Controllers
• Eloquent ORM (Object-‐Relational Mapping)
• Blade Templating
• Migrations and Database Seeding
http://www.webdesignermag.co.uk/laravel-‐a-‐modern-‐php-‐framework/
Models (Eloquents)
 Models are located
under app/ directory.
 Simple Product
model.
 Will use ‘products’ table
Laravel ORM
Why is it good?
- Has a lot of useful methods
- Is very flexible
- Has built in safe delete functionality
- Has built in Relationship functionality
- Has option to define scopes
Laravel ORM
- Models can have relations defined in
them for easier access to properties.
- $product->category in this case will
return Category model object where
this product belongs. How?
Laravel assumes you have category_id
in your products table, so when you call
$product->category query SELECT *
FROM ‘categories’ where id = ‘?’ is
performed. Of course you can define
different relation fields
Laravel ORM
Cool methods:
// Retrieve the user by the attributes, or create it if it doesn't exist...
$user = User::firstOrCreate(array('name' => 'John'));
// Retrieve the user by the attributes, or instantiate a new instance...
$user = User::firstOrNew(array('name' => 'John'));
Basically Laravels ORM has function for anything
Eloquent ORM
Q:A

More Related Content

What's hot

Laravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansLaravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web Artisans
Windzoon Technologies
 
Projects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 ProjectsProjects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 Projects
Sam Dias
 
Laravel
LaravelLaravel
Laravel
Dyuti Islam
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
Jeevesh Pandey
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
Brad Genereaux
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
Christopher Bartling
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Vikash Singh
 
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
AbhijeetKumar456867
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
Mayank Panchal
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
Aniruddh Bhilvare
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
Nitin Pande
 
Spring Boot
Spring BootSpring Boot
Spring Boot
Jiayun Zhou
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
Prem Sanil
 
RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
Tricode (part of Dept)
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
Edureka!
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
Sébastien Saunier
 
Why Laravel?
Why Laravel?Why Laravel?
Why Laravel?
Jonathan Goode
 
Restful web services ppt
Restful web services pptRestful web services ppt

What's hot (20)

Laravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansLaravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web Artisans
 
Projects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 ProjectsProjects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 Projects
 
Laravel
LaravelLaravel
Laravel
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
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
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Soap vs rest
Soap vs restSoap vs rest
Soap vs rest
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
 
Why Laravel?
Why Laravel?Why Laravel?
Why Laravel?
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 

Similar to Web Development with Laravel 5

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)
ssuser337865
 
Getting started with laravel
Getting started with laravelGetting started with laravel
Getting started with laravel
Advance Idea Infotech
 
Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)
Viral Solani
 
Lecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxLecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptx
SaziaRahman
 
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Lorvent56
 
Laravel 4 presentation
Laravel 4 presentationLaravel 4 presentation
Laravel 4 presentation
Abu Saleh Muhammad Shaon
 
Laravel : A Fastest Growing Kid
Laravel : A Fastest Growing KidLaravel : A Fastest Growing Kid
Laravel : A Fastest Growing Kid
Endive Software
 
Lecture11_LaravelGetStarted_SPring2023.pdf
Lecture11_LaravelGetStarted_SPring2023.pdfLecture11_LaravelGetStarted_SPring2023.pdf
Lecture11_LaravelGetStarted_SPring2023.pdf
ShaimaaMohamedGalal
 
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 TutorialAdventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Joe Ferguson
 
Laravel & Composer presentation - extended
Laravel & Composer presentation - extendedLaravel & Composer presentation - extended
Laravel & Composer presentation - extended
Cvetomir Denchev
 
MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5 MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5
Joe Ferguson
 
Web presentation
Web presentationWeb presentation
Web presentation
Solaiman Hossain Tuhin
 
Laravel - A Trending PHP Framework
Laravel - A Trending PHP FrameworkLaravel - A Trending PHP Framework
Laravel - A Trending PHP Framework
ijtsrd
 
laravel-interview-questions.pdf
laravel-interview-questions.pdflaravel-interview-questions.pdf
laravel-interview-questions.pdf
AnuragMourya8
 
Introduction to Laravel
Introduction to LaravelIntroduction to Laravel
Introduction to Laravel
Eli Wheaton
 
Laravel Presentation
Laravel PresentationLaravel Presentation
Laravel Presentation
REZAUL KARIM REFATH
 
Frequently Asked Questions About Laravel
Frequently Asked Questions About LaravelFrequently Asked Questions About Laravel
Frequently Asked Questions About Laravel
AResourcePool
 
Laravel Web Development: A Comprehensive Guide
Laravel Web Development: A Comprehensive GuideLaravel Web Development: A Comprehensive Guide
Laravel Web Development: A Comprehensive Guide
deep9753ak
 
Latest Laravel Practice 2023 Experts Guidance.pdf
Latest Laravel Practice 2023 Experts Guidance.pdfLatest Laravel Practice 2023 Experts Guidance.pdf
Latest Laravel Practice 2023 Experts Guidance.pdf
Sufalam Technologies
 

Similar to Web Development with Laravel 5 (20)

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)
 
Getting started with laravel
Getting started with laravelGetting started with laravel
Getting started with laravel
 
Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)
 
Lecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxLecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptx
 
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
 
Laravel 4 presentation
Laravel 4 presentationLaravel 4 presentation
Laravel 4 presentation
 
Laravel : A Fastest Growing Kid
Laravel : A Fastest Growing KidLaravel : A Fastest Growing Kid
Laravel : A Fastest Growing Kid
 
Lecture11_LaravelGetStarted_SPring2023.pdf
Lecture11_LaravelGetStarted_SPring2023.pdfLecture11_LaravelGetStarted_SPring2023.pdf
Lecture11_LaravelGetStarted_SPring2023.pdf
 
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 TutorialAdventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
 
Laravel & Composer presentation - extended
Laravel & Composer presentation - extendedLaravel & Composer presentation - extended
Laravel & Composer presentation - extended
 
MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5 MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5
 
Web presentation
Web presentationWeb presentation
Web presentation
 
Laravel - A Trending PHP Framework
Laravel - A Trending PHP FrameworkLaravel - A Trending PHP Framework
Laravel - A Trending PHP Framework
 
laravel-interview-questions.pdf
laravel-interview-questions.pdflaravel-interview-questions.pdf
laravel-interview-questions.pdf
 
Introduction to Laravel
Introduction to LaravelIntroduction to Laravel
Introduction to Laravel
 
Laravel Presentation
Laravel PresentationLaravel Presentation
Laravel Presentation
 
Frequently Asked Questions About Laravel
Frequently Asked Questions About LaravelFrequently Asked Questions About Laravel
Frequently Asked Questions About Laravel
 
Laravel Web Development: A Comprehensive Guide
Laravel Web Development: A Comprehensive GuideLaravel Web Development: A Comprehensive Guide
Laravel Web Development: A Comprehensive Guide
 
Latest Laravel Practice 2023 Experts Guidance.pdf
Latest Laravel Practice 2023 Experts Guidance.pdfLatest Laravel Practice 2023 Experts Guidance.pdf
Latest Laravel Practice 2023 Experts Guidance.pdf
 
Laravel Meetup
Laravel MeetupLaravel Meetup
Laravel Meetup
 

Recently uploaded

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
Jen Stirrup
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 

Recently uploaded (20)

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 

Web Development with Laravel 5

  • 1. Laravel 5 The PHP Framework ForWebArtisans
  • 2. What is Laravel?  PHP Framework for Web Artisans  Built on top of Symfony2 Components  Like any framework, provides services and libraries to make interacting with web requests and other services
  • 3. Most Popular PHP Framework on Github
  • 4. Stars 0 4000 16000 Laravel Symfony CodeIgniter Zend Slim 486950715313 5584 9517 12000 9854 8000 15329 CakePHP CodeIgniter Yii2 CakePHP Yii2Laravel Zend Symfony Slim March, 23 2015 https://github.com/search?l=php&o=desc&q=stars%3A%3E1&s=stars&type=Repositories
  • 5. • Initial Release • Languange • Architecture • License : June 2011 (latest: 5.0.16 March 14, 2015) : PHP (5.4+) : MVC : MIT http://en.wikipedia.org/wiki/Laravel Details
  • 6. Where to start from? Laravel is very flexible framework. There are at least 3 options how to create new project: - via laravel installer - via composer - clone from github
  • 7. Via Laravel installer This will download laravel installer via composer - composer global require "laravel/installer=~1.1" When installer added this simple command will create app - laravel new <app name> * Do not forget to add ~/.composer/vendor/bin to your PATH variable in ~/.bashrc
  • 8. Other options Via composer - composer create-project laravel/laravel your-project-name Get from GitHub - https://github.com/laravel/laravel - And then in the project dir run “composer install” to get all needed packages
  • 9. Laravel and Composer Using composer in Laravel you can - Add/remove/update packages - Dump autoload file and generate new one - Update laravel version
  • 13. What’s New? • New Folder Structure • Contracts (interface) • Route Middleware • Controller Method Injection • Laravel Scheduler • Tinker / Psysh • DotEnv (.env) • Form Requests • Symfony VarDumper
  • 16. Laravel directory structure The app directory, as you might expect, contains the core code of your application. The config directory, as the name implies, contains all of your application's configuration files. The database folder contains your database migration and seeds. The public directory contains the front controller and your assets (images, JavaScript, CSS, etc.). The app/storage directory contains compiled Blade templates, file based sessions, file caches, and other files generated by the framework. The tests directory contains your automated tests. The vendor directory contains your Composer dependencies. The app/model directory contains your model The app/http/controllers directory contains your model ...
  • 17. Magic Artisan - Is located in Laravel project root directory - Basically is a php script which performs all actions in Laravel for example: - Manage migrations - Check application routes - tinker - Create Artisan commands - Run database seeds Full list is available with “php artisan list”
  • 19. Artisan commands Artisan commands usually are some scripts launched from command line or with cron. For example you need to have daily export of your orders - write a command and run it with cron. - They accept options and arguments - Have pretty output if needed - Interactive (can ask password/question)
  • 20. Laravel Environmental Configuration  After installing Laravel and setting up project, the first thing we need to do is Generating Application key ( php artisan key:generate )  Laravel provides facility to run your application in different environment like testing, production,etc.  You can configure the environment of your application in the .env file of the root directory of your application.  If you have installed Laravel using composer, this file will automatically be created.otherwise, you can simply rename the .env.example file to .env file
  • 21. Environmental Configuration (Continue)  This is a sample .env file  you can both keep configuration/environ ment variables in .env or in a config/ file  Next we’ll see how to keep config in config/ file
  • 22. Laravel Config Laravel uses config files with arrays in it to store different configurations. database.php -> Location: /config To get config value simply follow dot notation Config::get(‘<filename>.key1.key2.key3’); Can also pass default value on not found Config::get(‘key’, 123);
  • 23. Laravel actively uses php namespaces to keep classnames short and possibility to use same class names for different components. For example all Admin functionality under Admin namespace. Laravel and namespaces
  • 24. So Laravel is MVC framework meaning we have folder for controllers, views and models by default, no need to create them. Guess there’s no need to explain MVC pattern. Laravel MVC
  • 26. Features • Artisan CLI • Routing • Middleware • Resourceful Controllers • Eloquent ORM (Object-‐Relational Mapping) • Blade Templating • Migrations and Database Seeding http://www.webdesignermag.co.uk/laravel-‐a-‐modern-‐php-‐framework/
  • 27. Features • Artisan CLI • Routing • Middleware • Resourceful Controllers • Eloquent ORM (Object-‐Relational Mapping) • Blade Templating • Migrations and Database Seeding http://www.webdesignermag.co.uk/laravel-‐a-‐modern-‐php-‐framework/
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56. Features • Artisan CLI • Routing • Middleware • Resourceful Controllers • Eloquent ORM (Object-‐Relational Mapping) • Blade Templating • Migrations and Database Seeding http://www.webdesignermag.co.uk/laravel-‐a-‐modern-‐php-‐framework/
  • 57.
  • 58.
  • 59.
  • 60. Features • Artisan CLI • Routing • Middleware • Resourceful Controllers • Eloquent ORM (Object-‐Relational Mapping) • Blade Templating • Migrations and Database Seeding http://www.webdesignermag.co.uk/laravel-‐a-‐modern-‐php-‐framework/
  • 61.  There’s one main Controller class which all controllers should extend.  By default Laravel has BaseController (extends from Controller) and HomeController (extends from BaseController) Laravel controllers
  • 62.
  • 63. Laravel controllers More advanced example. Responds only to get method and returns rendered view Responds to post method, and returns redirect to next logical action
  • 64.
  • 65.
  • 66.
  • 67. Type-hint any dependency in controller constructors Type-hint any dependency in Controller methods
  • 68. Features • Artisan CLI • Routing • Middleware • Resourceful Controllers • Eloquent ORM (Object-‐Relational Mapping) • Blade Templating • Migrations and Database Seeding http://www.webdesignermag.co.uk/laravel-‐a-‐modern-‐php-‐framework/
  • 69. Blade
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77. Laravel migrations  Interaction with migrations is happening through artisan commands.  Each migration has two functions up and down to migrate and rollback
  • 78. Features • Artisan CLI • Routing • Middleware • Resourceful Controllers • Migrations and Database Seeding • Eloquent ORM (Object-‐Relational Mapping) • Blade Templating http://www.webdesignermag.co.uk/laravel-‐a-‐modern-‐php-‐framework/
  • 79. Laravel migrations  This is how basic migration looks like
  • 80. DB seeds  Seeds are used to insert predefined data in tables so there is something to start from for example on development environment we can create test users, test products and so on.
  • 81. Features • Artisan CLI • Routing • Middleware • Resourceful Controllers • Eloquent ORM (Object-‐Relational Mapping) • Blade Templating • Migrations and Database Seeding http://www.webdesignermag.co.uk/laravel-‐a-‐modern-‐php-‐framework/
  • 82. Models (Eloquents)  Models are located under app/ directory.  Simple Product model.  Will use ‘products’ table
  • 83. Laravel ORM Why is it good? - Has a lot of useful methods - Is very flexible - Has built in safe delete functionality - Has built in Relationship functionality - Has option to define scopes
  • 84. Laravel ORM - Models can have relations defined in them for easier access to properties. - $product->category in this case will return Category model object where this product belongs. How? Laravel assumes you have category_id in your products table, so when you call $product->category query SELECT * FROM ‘categories’ where id = ‘?’ is performed. Of course you can define different relation fields
  • 85. Laravel ORM Cool methods: // Retrieve the user by the attributes, or create it if it doesn't exist... $user = User::firstOrCreate(array('name' => 'John')); // Retrieve the user by the attributes, or instantiate a new instance... $user = User::firstOrNew(array('name' => 'John')); Basically Laravels ORM has function for anything
  • 87. Q:A