SlideShare a Scribd company logo
1 of 26
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

What's hot

Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Dilouar Hossain
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data BindingDuy Khanh
 
Angular tutorial
Angular tutorialAngular tutorial
Angular tutorialRohit Gupta
 
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.pptxAbhijeetKumar456867
 
JDBC Java Database Connectivity
JDBC Java Database ConnectivityJDBC Java Database Connectivity
JDBC Java Database ConnectivityRanjan Kumar
 
Angular 8
Angular 8 Angular 8
Angular 8 Sunil OS
 
Introduction to laravel framework
Introduction to laravel frameworkIntroduction to laravel framework
Introduction to laravel frameworkAhmad Fatoni
 
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 FrameworkShravan A
 
Web application development with laravel php framework version 4
Web application development with laravel php framework version 4Web application development with laravel php framework version 4
Web application development with laravel php framework version 4Untung D Saptoto
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - DirectivesWebStackAcademy
 
NextJS, A JavaScript Framework for building next generation SPA
NextJS, A JavaScript Framework for building next generation SPA  NextJS, A JavaScript Framework for building next generation SPA
NextJS, A JavaScript Framework for building next generation SPA Pramendra Gupta
 

What's hot (20)

Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
 
Laravel Presentation
Laravel PresentationLaravel Presentation
Laravel Presentation
 
Laravel Introduction
Laravel IntroductionLaravel Introduction
Laravel Introduction
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
 
Angular tutorial
Angular tutorialAngular tutorial
Angular tutorial
 
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
 
JDBC Java Database Connectivity
JDBC Java Database ConnectivityJDBC Java Database Connectivity
JDBC Java Database Connectivity
 
Angular 8
Angular 8 Angular 8
Angular 8
 
Introduction to laravel framework
Introduction to laravel frameworkIntroduction to laravel framework
Introduction to laravel framework
 
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
 
Web application development with laravel php framework version 4
Web application development with laravel php framework version 4Web application development with laravel php framework version 4
Web application development with laravel php framework version 4
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Why Laravel?
Why Laravel?Why Laravel?
Why Laravel?
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
 
Angular introduction students
Angular introduction studentsAngular introduction students
Angular introduction students
 
Angular
AngularAngular
Angular
 
NextJS, A JavaScript Framework for building next generation SPA
NextJS, A JavaScript Framework for building next generation SPA  NextJS, A JavaScript Framework for building next generation SPA
NextJS, A JavaScript Framework for building next generation SPA
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
 

Viewers also liked

Php internal architecture
Php internal architecturePhp internal architecture
Php internal architectureElizabeth Smith
 
PHP 7 performances from PHP 5
PHP 7 performances from PHP 5PHP 7 performances from PHP 5
PHP 7 performances from PHP 5julien pauli
 
PHP Optimization
PHP OptimizationPHP Optimization
PHP Optimizationdjesch
 
Internet of Things With PHP
Internet of Things With PHPInternet of Things With PHP
Internet of Things With PHPAdam Englander
 
PHP, Under The Hood - DPC
PHP, Under The Hood - DPCPHP, Under The Hood - DPC
PHP, Under The Hood - DPCAnthony Ferrara
 
Being functional in PHP (PHPDay Italy 2016)
Being functional in PHP (PHPDay Italy 2016)Being functional in PHP (PHPDay Italy 2016)
Being functional in PHP (PHPDay Italy 2016)David de Boer
 
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南Shengyou Fan
 
How PHP Works ?
How PHP Works ?How PHP Works ?
How PHP Works ?Ravi Raj
 
LaravelConf Taiwan 2017 開幕
LaravelConf Taiwan 2017 開幕LaravelConf Taiwan 2017 開幕
LaravelConf Taiwan 2017 開幕Shengyou Fan
 
Route 路由控制
Route 路由控制Route 路由控制
Route 路由控制Shengyou Fan
 

Viewers also liked (14)

Php internal architecture
Php internal architecturePhp internal architecture
Php internal architecture
 
PHP 7 performances from PHP 5
PHP 7 performances from PHP 5PHP 7 performances from PHP 5
PHP 7 performances from PHP 5
 
PHP Optimization
PHP OptimizationPHP Optimization
PHP Optimization
 
Internet of Things With PHP
Internet of Things With PHPInternet of Things With PHP
Internet of Things With PHP
 
PHP, Under The Hood - DPC
PHP, Under The Hood - DPCPHP, Under The Hood - DPC
PHP, Under The Hood - DPC
 
PHP WTF
PHP WTFPHP WTF
PHP WTF
 
PHP 7 new engine
PHP 7 new enginePHP 7 new engine
PHP 7 new engine
 
Being functional in PHP (PHPDay Italy 2016)
Being functional in PHP (PHPDay Italy 2016)Being functional in PHP (PHPDay Italy 2016)
Being functional in PHP (PHPDay Italy 2016)
 
Php
PhpPhp
Php
 
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
 
How PHP Works ?
How PHP Works ?How PHP Works ?
How PHP Works ?
 
Php 101: PDO
Php 101: PDOPhp 101: PDO
Php 101: PDO
 
LaravelConf Taiwan 2017 開幕
LaravelConf Taiwan 2017 開幕LaravelConf Taiwan 2017 開幕
LaravelConf Taiwan 2017 開幕
 
Route 路由控制
Route 路由控制Route 路由控制
Route 路由控制
 

Similar to Laravel Beginners Tutorial 1

App development with quasar (pdf)
App development with quasar (pdf)App development with quasar (pdf)
App development with quasar (pdf)wonyong hwang
 
Laravel Beginners Tutorial 2
Laravel Beginners Tutorial 2Laravel Beginners Tutorial 2
Laravel Beginners Tutorial 2Vikas Chauhan
 
Laravel - Website Development in Php Framework.
Laravel - Website Development in Php Framework.Laravel - Website Development in Php Framework.
Laravel - Website Development in Php Framework.SWAAM Tech
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php PresentationAlan Pinstein
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5Darren Craig
 
以 Laravel 經驗開發 Hyperf 應用
以 Laravel 經驗開發 Hyperf 應用以 Laravel 經驗開發 Hyperf 應用
以 Laravel 經驗開發 Hyperf 應用Shengyou Fan
 
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
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalDrupalDay
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupalsparkfabrik
 
Automate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon ViennaAutomate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon ViennaPantheon
 
Modern Web Application Development Workflow - EclipseCon Europe 2014
Modern Web Application Development Workflow - EclipseCon Europe 2014Modern Web Application Development Workflow - EclipseCon Europe 2014
Modern Web Application Development Workflow - EclipseCon Europe 2014Stéphane Bégaudeau
 
Dockerize Laravel Application
Dockerize Laravel ApplicationDockerize Laravel Application
Dockerize Laravel ApplicationAfrimadoni Dinata
 
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみたネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみたfurusin
 
Getting started with agile database migrations for java flywaydb
Getting started with agile database migrations for java flywaydbGetting started with agile database migrations for java flywaydb
Getting started with agile database migrations for java flywaydbGirish Bapat
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundryrajdeep
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsJim Jeffers
 

Similar to Laravel Beginners Tutorial 1 (20)

App development with quasar (pdf)
App development with quasar (pdf)App development with quasar (pdf)
App development with quasar (pdf)
 
Laravel Beginners Tutorial 2
Laravel Beginners Tutorial 2Laravel Beginners Tutorial 2
Laravel Beginners Tutorial 2
 
Laravel - Website Development in Php Framework.
Laravel - Website Development in Php Framework.Laravel - Website Development in Php Framework.
Laravel - Website Development in Php Framework.
 
Workshop Laravel 5.2
Workshop Laravel 5.2Workshop Laravel 5.2
Workshop Laravel 5.2
 
Presentation laravel 5 4
Presentation laravel 5 4Presentation laravel 5 4
Presentation laravel 5 4
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5
 
以 Laravel 經驗開發 Hyperf 應用
以 Laravel 經驗開發 Hyperf 應用以 Laravel 經驗開發 Hyperf 應用
以 Laravel 經驗開發 Hyperf 應用
 
MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5 MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
 
Maven
MavenMaven
Maven
 
Automate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon ViennaAutomate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon Vienna
 
Modern Web Application Development Workflow - EclipseCon Europe 2014
Modern Web Application Development Workflow - EclipseCon Europe 2014Modern Web Application Development Workflow - EclipseCon Europe 2014
Modern Web Application Development Workflow - EclipseCon Europe 2014
 
Javascript laravel's friend
Javascript laravel's friendJavascript laravel's friend
Javascript laravel's friend
 
Dockerize Laravel Application
Dockerize Laravel ApplicationDockerize Laravel Application
Dockerize Laravel Application
 
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみたネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
 
Getting started with agile database migrations for java flywaydb
Getting started with agile database migrations for java flywaydbGetting started with agile database migrations for java flywaydb
Getting started with agile database migrations for java flywaydb
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundry
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in Rails
 

Recently uploaded

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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...DianaGray10
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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 TerraformAndrey Devyatkin
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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 Takeoffsammart93
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Recently uploaded (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

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 – vikas.chauhan@braincoerce.com Phone – (080) 41155974

Editor's Notes

  1. ‘layout’is a folder in view and ‘default’ is file in ‘layout’ folder.