SlideShare a Scribd company logo
1 Author : Vikas Chauhan
Presented By:
Vikas Chauhan
Software Engineer,
BrainCoerce Technologies, Bangalore
Date – 08/08/2013
2
 Exercise 1 :- Installation and configuration
 Exercise 2 :- Write Hello World Program
 Exercise 3 :- Laravel Blade
 Exercise 4 :- Laravel Blade & Layout
 Exercise 5:- Types of Route
Author : Vikas Chauhan
3
Exercise 1
Installation and configuration
Author : Vikas Chauhan
4
Task 1 :- Install Composer.
- Go to http://getcomposer.org/ and download.
Author : Vikas Chauhan
5
Task 2 :- Install & configure Laravel
 Via Composer Create-Project :- Using commend composer create-
project laravel/laravel [directory]
(see:- http://www.youtube.com/watch?v=DD_-
l5AZY1A&feature=youtu.be )
 Using commend install composer ( see:-
http://www.youtube.com/watch?v=WW1CPLOzRH4&feature=youtu.be
)
 Generate key :- using commend php artisan key:generate (see :-
http://www.youtube.com/watch?v=87bYRrzCSUw&feature=youtu.be )
 Copy that unique generate key and paste into ‘app/config/app.php
file.
 Rename ‘server.php’ to ‘index.php’ .
Author : Vikas Chauhan
6
Task 3 :- Run Laravel
 Enter the url http://localhost/laravellab/public/ on
browser. (url should be change according to your localhost path.)
Author : Vikas Chauhan
7
Exercise 2
Write Hello World
Author : Vikas Chauhan
8
Task 1 :- Create welcome controller
 Using commend php artisan controller:make WelcomeController
(see :-
http://www.youtube.com/watch?v=BeIiGERN1tc&feature=youtu.
be )
Author : Vikas Chauhan
9
Task 2 :- Create welcome action
See:- https://gist.github.com/leonguyen/6000768
Author : Vikas Chauhan
10
Task 3 :- Routing Welcome Controller
See:- https://gist.github.com/leonguyen/6000930
Author : Vikas Chauhan
11
Task 4 :- Run
 Enter URL http://localhost/laravellab/index.php/welcome on the
browser .
Author : Vikas Chauhan
12
Exercise 3
Laravel Blade
Author : Vikas Chauhan
13
Task 1 :- app -> Controller -> DemoController
<?php class DemoController extends BaseController
{
public $restful = true;
public function get_index()
{
$title = ‘laravel page';
$View= View::make('demo1.index' , array(
'name'=>laravel user',
'age'=>'28',
'location'=>'bangalore'))
->with('title',$title);
return $View;
}
}
Author : Vikas Chauhan
14
Task 2 :- app ->View -> demo1 -> index.blade.php
<h1>My first controller</h1>
@if(isset($name))
{{ $age }} <br/>
@else
{{ $name }} <br/>
@endif
{{ $age }} <br/>
{{ $location }} <br/>
Author : Vikas Chauhan
15
Task 3 :- app-> route.php
Route::controller('demo1','DemoController');
Task 5 :- Run
Enter URL http://localhost/laravellab/index.php/demo1 on the
browser
Author : Vikas Chauhan
16
Exercise 4
Laravel Blade Layout
Author : Vikas Chauhan
17
Task 1 :- app -> Controller -> DemoController
<?php class DemoController extends BaseController
{
public $restful = true;
public $layout = 'layout.default';
public function get_index()
{
$this->layout->title = laravelpage';
$View= View::make('demo1.index' , array(
'name'=>Laravel user',
'age'=>'28',
'location'=>'bangalore'));
$this->layout->content= $View;
}
}
Author : Vikas Chauhan
18
Task 2 :- app ->View -> demo1 -> index.blade.php
<h1>My first controller</h1>
@if(isset($name))
{{ $age }} <br/>
@else
{{ $name }} <br/>
@endif
{{ $age }} <br/>
{{ $location }} <br/>
Author : Vikas Chauhan
19
Task 3 :- app ->View -> demo1 -> index.blade.php
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{ $title }}</title>
</head>
<body>
{{ $content }}
</body>
</html>
Author : Vikas Chauhan
20
Task 4 :- app-> route.php
Route::controller('demo1','DemoController');
Task 5 :- Run
Enter URL http://localhost/laravellab/index.php/demo1 on the browser
Author : Vikas Chauhan
21
Exercise 5
Types of Route
Author : Vikas Chauhan
22
Echo by route:- route.php
Route::get (‘about’, function() {
return “hello world”;
});
Echo by view:-
in view folder create a php file named hello
route.php :-
Route::get (‘/’, function() {
return view::make(‘hello’);
});
Author : Vikas Chauhan
23
Echo by only controller:-
route.php :-
Route::resource(‘demo1’, ‘controllername);
In controller
<?php class DemoController extends BaseController
{
public function get_index()
{
echo ‘hello world’;
}
}
Author : Vikas Chauhan
24
Echo by controller and view:-
route.php :-
Route::controller(‘demo1’, ‘controllername);
In controller :-
<?php class DemoController extends BaseController
{
public function get_index()
{
$View= View::make('demo1.index' , array(
'name'=>’laravel user ‘ )) ;
return $View;
}
}
In view :- create a folder named demo1 and make a php fiile named
index.php
Author : Vikas Chauhan
25
Restful route:-
route.php :-
Route::controller(‘pathname’, ‘controllername@function_name’);
In controller :-
<?php class DemoController extends BaseController
{
public function get_index()
{
$View= View::make('demo1.index' , array(
'name'=>’laravel User ‘ )) ;
return $View;
}
}
In view :- create a folder named demo1 and make a php fiile named
index.php
Author : Vikas Chauhan
26
Thanks & Regards,
Contact to – Vikas Chauhan
Email ID – vikas.chauhan@braincoerce.com
Phone – (080) 41155974

More Related Content

PPTX
Laravel ppt
Mayank Panchal
 
PPTX
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Dilouar Hossain
 
PPTX
Introduction to laravel framework
Ahmad Fatoni
 
PPT
Docker introduction
Phuc Nguyen
 
PPTX
laravel.pptx
asif290119
 
PPT
SQLITE Android
Sourabh Sahu
 
PPTX
Laravel introduction
Simon Funk
 
PPTX
Laravel overview
Obinna Akunne
 
Laravel ppt
Mayank Panchal
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Dilouar Hossain
 
Introduction to laravel framework
Ahmad Fatoni
 
Docker introduction
Phuc Nguyen
 
laravel.pptx
asif290119
 
SQLITE Android
Sourabh Sahu
 
Laravel introduction
Simon Funk
 
Laravel overview
Obinna Akunne
 

What's hot (20)

PPTX
Laravel Tutorial PPT
Piyush Aggarwal
 
PPTX
Laravel
Dyuti Islam
 
PDF
Dockerfile
Jeffrey Ellin
 
PDF
Angular Directives
iFour Technolab Pvt. Ltd.
 
PDF
Docker Compose by Aanand Prasad
Docker, Inc.
 
PDF
Laravel presentation
Toufiq Mahmud
 
PPTX
Jenkins presentation
Valentin Buryakov
 
PPTX
Getting started with Docker
Ravindu Fernando
 
PPTX
Introduction to Docker
Pubudu Jayawardana
 
PDF
Laravel Introduction
Ahmad Shah Hafizan Hamidin
 
PDF
Jenkins Tutorial.pdf
devtestervicky
 
PDF
Introduction to docker
Instruqt
 
ODP
An Introduction To Jenkins
Knoldus Inc.
 
PDF
Clean code
Arturo Herrero
 
PPS
JSP Error handling
kamal kotecha
 
PDF
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Edureka!
 
PDF
Javascript essentials
Bedis ElAchèche
 
PPT
Maven Overview
FastConnect
 
PPTX
C# Tutorial
Jm Ramos
 
PDF
Introduction to docker and docker compose
Lalatendu Mohanty
 
Laravel Tutorial PPT
Piyush Aggarwal
 
Laravel
Dyuti Islam
 
Dockerfile
Jeffrey Ellin
 
Angular Directives
iFour Technolab Pvt. Ltd.
 
Docker Compose by Aanand Prasad
Docker, Inc.
 
Laravel presentation
Toufiq Mahmud
 
Jenkins presentation
Valentin Buryakov
 
Getting started with Docker
Ravindu Fernando
 
Introduction to Docker
Pubudu Jayawardana
 
Laravel Introduction
Ahmad Shah Hafizan Hamidin
 
Jenkins Tutorial.pdf
devtestervicky
 
Introduction to docker
Instruqt
 
An Introduction To Jenkins
Knoldus Inc.
 
Clean code
Arturo Herrero
 
JSP Error handling
kamal kotecha
 
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Edureka!
 
Javascript essentials
Bedis ElAchèche
 
Maven Overview
FastConnect
 
C# Tutorial
Jm Ramos
 
Introduction to docker and docker compose
Lalatendu Mohanty
 
Ad

Viewers also liked (14)

PPTX
Php internal architecture
Elizabeth Smith
 
PDF
PHP 7 performances from PHP 5
julien pauli
 
PPTX
PHP Optimization
djesch
 
PPTX
Internet of Things With PHP
Adam Englander
 
PDF
PHP, Under The Hood - DPC
Anthony Ferrara
 
PDF
PHP WTF
markstory
 
PDF
PHP 7 new engine
julien pauli
 
PDF
Being functional in PHP (PHPDay Italy 2016)
David de Boer
 
PPTX
Php
Shyam Khant
 
PDF
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
Shengyou Fan
 
PPT
How PHP Works ?
Ravi Raj
 
KEY
Php 101: PDO
Jeremy Kendall
 
PDF
LaravelConf Taiwan 2017 開幕
Shengyou Fan
 
PDF
Route 路由控制
Shengyou Fan
 
Php internal architecture
Elizabeth Smith
 
PHP 7 performances from PHP 5
julien pauli
 
PHP Optimization
djesch
 
Internet of Things With PHP
Adam Englander
 
PHP, Under The Hood - DPC
Anthony Ferrara
 
PHP WTF
markstory
 
PHP 7 new engine
julien pauli
 
Being functional in PHP (PHPDay Italy 2016)
David de Boer
 
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
Shengyou Fan
 
How PHP Works ?
Ravi Raj
 
Php 101: PDO
Jeremy Kendall
 
LaravelConf Taiwan 2017 開幕
Shengyou Fan
 
Route 路由控制
Shengyou Fan
 
Ad

Similar to Laravel Beginners Tutorial 1 (20)

PDF
App development with quasar (pdf)
wonyong hwang
 
PPTX
Laravel Beginners Tutorial 2
Vikas Chauhan
 
PPTX
Laravel - Website Development in Php Framework.
SWAAM Tech
 
PPTX
Workshop Laravel 5.2
Wahyu Rismawan
 
ODP
Presentation laravel 5 4
Christen Gjølbye Christensen
 
PDF
Lean Php Presentation
Alan Pinstein
 
PDF
What's New In Laravel 5
Darren Craig
 
PDF
以 Laravel 經驗開發 Hyperf 應用
Shengyou Fan
 
PDF
MidwestPHP 2016 - Adventures in Laravel 5
Joe Ferguson
 
PDF
Behaviour Driven Development con Behat & Drupal
DrupalDay
 
PDF
Behaviour Driven Development con Behat & Drupal
sparkfabrik
 
PPTX
Maven
feng lee
 
PDF
Automate Your Automation | DrupalCon Vienna
Pantheon
 
PDF
Modern Web Application Development Workflow - EclipseCon Europe 2014
Stéphane Bégaudeau
 
ODP
Javascript laravel's friend
Bart Van Den Brande
 
PDF
Dockerize Laravel Application
Afrimadoni Dinata
 
PDF
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
furusin
 
PPTX
Getting started with agile database migrations for java flywaydb
Girish Bapat
 
KEY
Play Support in Cloud Foundry
rajdeep
 
PDF
Building Mobile Friendly APIs in Rails
Jim Jeffers
 
App development with quasar (pdf)
wonyong hwang
 
Laravel Beginners Tutorial 2
Vikas Chauhan
 
Laravel - Website Development in Php Framework.
SWAAM Tech
 
Workshop Laravel 5.2
Wahyu Rismawan
 
Presentation laravel 5 4
Christen Gjølbye Christensen
 
Lean Php Presentation
Alan Pinstein
 
What's New In Laravel 5
Darren Craig
 
以 Laravel 經驗開發 Hyperf 應用
Shengyou Fan
 
MidwestPHP 2016 - Adventures in Laravel 5
Joe Ferguson
 
Behaviour Driven Development con Behat & Drupal
DrupalDay
 
Behaviour Driven Development con Behat & Drupal
sparkfabrik
 
Maven
feng lee
 
Automate Your Automation | DrupalCon Vienna
Pantheon
 
Modern Web Application Development Workflow - EclipseCon Europe 2014
Stéphane Bégaudeau
 
Javascript laravel's friend
Bart Van Den Brande
 
Dockerize Laravel Application
Afrimadoni Dinata
 
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
furusin
 
Getting started with agile database migrations for java flywaydb
Girish Bapat
 
Play Support in Cloud Foundry
rajdeep
 
Building Mobile Friendly APIs in Rails
Jim Jeffers
 

Recently uploaded (20)

PDF
Software Development Company | KodekX
KodekX
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Best ERP System for Manufacturing in India | Elite Mindz
Elite Mindz
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PPTX
Coupa-Overview _Assumptions presentation
annapureddyn
 
PDF
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PPTX
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
PPT
L2 Rules of Netiquette in Empowerment technology
Archibal2
 
PPTX
Stamford - Community User Group Leaders_ Agentblazer Status, AI Sustainabilit...
Amol Dixit
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Chapter 1 Introduction to CV and IP Lecture Note.pdf
Getnet Tigabie Askale -(GM)
 
PDF
DevOps & Developer Experience Summer BBQ
AUGNYC
 
Software Development Company | KodekX
KodekX
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Best ERP System for Manufacturing in India | Elite Mindz
Elite Mindz
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
Coupa-Overview _Assumptions presentation
annapureddyn
 
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
L2 Rules of Netiquette in Empowerment technology
Archibal2
 
Stamford - Community User Group Leaders_ Agentblazer Status, AI Sustainabilit...
Amol Dixit
 
This slide provides an overview Technology
mineshkharadi333
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Chapter 1 Introduction to CV and IP Lecture Note.pdf
Getnet Tigabie Askale -(GM)
 
DevOps & Developer Experience Summer BBQ
AUGNYC
 

Laravel Beginners Tutorial 1

  • 1. 1 Author : Vikas Chauhan Presented By: Vikas Chauhan Software Engineer, BrainCoerce Technologies, Bangalore Date – 08/08/2013
  • 2. 2  Exercise 1 :- Installation and configuration  Exercise 2 :- Write Hello World Program  Exercise 3 :- Laravel Blade  Exercise 4 :- Laravel Blade & Layout  Exercise 5:- Types of Route Author : Vikas Chauhan
  • 3. 3 Exercise 1 Installation and configuration Author : Vikas Chauhan
  • 4. 4 Task 1 :- Install Composer. - Go to http://getcomposer.org/ and download. Author : Vikas Chauhan
  • 5. 5 Task 2 :- Install & configure Laravel  Via Composer Create-Project :- Using commend composer create- project laravel/laravel [directory] (see:- http://www.youtube.com/watch?v=DD_- l5AZY1A&feature=youtu.be )  Using commend install composer ( see:- http://www.youtube.com/watch?v=WW1CPLOzRH4&feature=youtu.be )  Generate key :- using commend php artisan key:generate (see :- http://www.youtube.com/watch?v=87bYRrzCSUw&feature=youtu.be )  Copy that unique generate key and paste into ‘app/config/app.php file.  Rename ‘server.php’ to ‘index.php’ . Author : Vikas Chauhan
  • 6. 6 Task 3 :- Run Laravel  Enter the url http://localhost/laravellab/public/ on browser. (url should be change according to your localhost path.) Author : Vikas Chauhan
  • 7. 7 Exercise 2 Write Hello World Author : Vikas Chauhan
  • 8. 8 Task 1 :- Create welcome controller  Using commend php artisan controller:make WelcomeController (see :- http://www.youtube.com/watch?v=BeIiGERN1tc&feature=youtu. be ) Author : Vikas Chauhan
  • 9. 9 Task 2 :- Create welcome action See:- https://gist.github.com/leonguyen/6000768 Author : Vikas Chauhan
  • 10. 10 Task 3 :- Routing Welcome Controller See:- https://gist.github.com/leonguyen/6000930 Author : Vikas Chauhan
  • 11. 11 Task 4 :- Run  Enter URL http://localhost/laravellab/index.php/welcome on the browser . Author : Vikas Chauhan
  • 13. 13 Task 1 :- app -> Controller -> DemoController <?php class DemoController extends BaseController { public $restful = true; public function get_index() { $title = ‘laravel page'; $View= View::make('demo1.index' , array( 'name'=>laravel user', 'age'=>'28', 'location'=>'bangalore')) ->with('title',$title); return $View; } } Author : Vikas Chauhan
  • 14. 14 Task 2 :- app ->View -> demo1 -> index.blade.php <h1>My first controller</h1> @if(isset($name)) {{ $age }} <br/> @else {{ $name }} <br/> @endif {{ $age }} <br/> {{ $location }} <br/> Author : Vikas Chauhan
  • 15. 15 Task 3 :- app-> route.php Route::controller('demo1','DemoController'); Task 5 :- Run Enter URL http://localhost/laravellab/index.php/demo1 on the browser Author : Vikas Chauhan
  • 16. 16 Exercise 4 Laravel Blade Layout Author : Vikas Chauhan
  • 17. 17 Task 1 :- app -> Controller -> DemoController <?php class DemoController extends BaseController { public $restful = true; public $layout = 'layout.default'; public function get_index() { $this->layout->title = laravelpage'; $View= View::make('demo1.index' , array( 'name'=>Laravel user', 'age'=>'28', 'location'=>'bangalore')); $this->layout->content= $View; } } Author : Vikas Chauhan
  • 18. 18 Task 2 :- app ->View -> demo1 -> index.blade.php <h1>My first controller</h1> @if(isset($name)) {{ $age }} <br/> @else {{ $name }} <br/> @endif {{ $age }} <br/> {{ $location }} <br/> Author : Vikas Chauhan
  • 19. 19 Task 3 :- app ->View -> demo1 -> index.blade.php <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>{{ $title }}</title> </head> <body> {{ $content }} </body> </html> Author : Vikas Chauhan
  • 20. 20 Task 4 :- app-> route.php Route::controller('demo1','DemoController'); Task 5 :- Run Enter URL http://localhost/laravellab/index.php/demo1 on the browser Author : Vikas Chauhan
  • 21. 21 Exercise 5 Types of Route Author : Vikas Chauhan
  • 22. 22 Echo by route:- route.php Route::get (‘about’, function() { return “hello world”; }); Echo by view:- in view folder create a php file named hello route.php :- Route::get (‘/’, function() { return view::make(‘hello’); }); Author : Vikas Chauhan
  • 23. 23 Echo by only controller:- route.php :- Route::resource(‘demo1’, ‘controllername); In controller <?php class DemoController extends BaseController { public function get_index() { echo ‘hello world’; } } Author : Vikas Chauhan
  • 24. 24 Echo by controller and view:- route.php :- Route::controller(‘demo1’, ‘controllername); In controller :- <?php class DemoController extends BaseController { public function get_index() { $View= View::make('demo1.index' , array( 'name'=>’laravel user ‘ )) ; return $View; } } In view :- create a folder named demo1 and make a php fiile named index.php Author : Vikas Chauhan
  • 25. 25 Restful route:- route.php :- Route::controller(‘pathname’, ‘controllername@function_name’); In controller :- <?php class DemoController extends BaseController { public function get_index() { $View= View::make('demo1.index' , array( 'name'=>’laravel User ‘ )) ; return $View; } } In view :- create a folder named demo1 and make a php fiile named index.php Author : Vikas Chauhan
  • 26. 26 Thanks & Regards, Contact to – Vikas Chauhan Email ID – [email protected] Phone – (080) 41155974

Editor's Notes

  • #18: ‘layout’is a folder in view and ‘default’ is file in ‘layout’ folder.