Skip to content
InfinityKnow

InfinityKnow

Infinity Knowledge (IK) : Technology, Articles, Topics, Facts or many More.

  • Home
  • Education
    • yttags
    • Make Money
    • Jobs
    • Programming
      • Technology
      • Web Design
      • WEB HOSTING
      • Interview
  • Entertainment
    • pakainfo
    • Sports
    • Tips and Tricks
      • Law
      • Photography
      • Travel
  • Health
    • Insurance
    • Lifestyle
      • Clothing
      • Fashion
      • Food
  • News
    • Insurance
      • Auto Car Insurance
      • Business Insurance
    • Donate
    • California
  • News
    • Political
  • Home Improvement
  • Trading
    • Marketing
    • Top Tranding
    • Business
    • Real Estate
  • Full Form
  • Contact Us
  • Angular ng-app directive Example Technology
  • Bewafa shayari
    Bewafa shayari Shayari
  • Angular Arithmetic Operations BODMAS Rule Technology
  • Angularjs Insert Update Delete CRUD
    Angularjs Insert Update Delete CRUD Technology
  • Multiple Image Upload in php with Database
    Multiple Image Upload in php with Database Technology
  • Angular 4 CRUD Operation MVC - Angular 4 insert update delete
    Gussa shayari Shayari
  • Angularjs Custom Animation nganimate Examples
    Angularjs Custom Animation nganimate Examples Technology
  • Multipart Form Data File Upload Examples
    Multipart Form Data File Upload Examples Technology
laravel get route parameters in controller,laravel route controller,laravel route parameters,laravel route wildcard,laravel route middleware,laravel route(),laravel route api,laravel get route name

Laravel Routing GET and POST Route parameters controller

Posted on June 11, 2019 By admin No Comments on Laravel Routing GET and POST Route parameters controller

Laravel Routing GET and POST Route parameters controller

In this Post We Will Explain About is Laravel Routing GET and POST Route parameters controller With Example and Demo.Welcome on infinityknow.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Simple Basic Routing using LaravelExample

In this post we will show you Best way to implement laravel route parameters controller, hear for php – How to route GET and POST in Laravelwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Available Router Methods

There are the following list of the Laravel Route methodes
1.Route::get($uri, $callback);
2.Route::post($uri, $callback);
3.Route::put($uri, $callback);
4.Route::patch($uri, $callback);
5.Route::delete($uri, $callback);
6.Route::options($uri, $callback);

Open routes.php file. and simple The file is located in /app/Http/
Add the simple following code to routes.php

READ :  Angularjs Convert Comma separated String To Array Example

Laravel Route GET Route

[php]
Route::get(‘/’, function()
{
//return message
return ‘welcome – infinityknow.com – Good Luck.!!’;
});
[/php]

Laravel Route POST Route

[php]
Route::post(‘home/admin’, function()
{
//return message
return ‘welcome – infinityknow.com – Good Luck.!!’;
});
[/php]

Laravel Route Registering A Route For Multiple Verbs

[php]
Route::match(array(‘GET’, ‘POST’), ‘/’, function()
{
//return message
return ‘welcome – infinityknow.com – Good Luck.!!’;
});
[/php]

Laravel Route Registering A Route Responding To Any HTTP Verb

[php]
Route::any(‘home’, function()
{
//return message
return ‘welcome – infinityknow.com – Good Luck.!!’;
});
[/php]

Laravel Route Forcing A Route To Be Served Over HTTPS

[php]
Route::get(‘home’, array(‘https’, function()
{
//return must be https
return ‘here simple or Must be over HTTPS’;
}));
[/php]

Laravel Route using the URL::to method:

[php]
$get_url = URL::to(‘home’);
[/php]

READ :  Remove whitespace AngularJs Trim String

Laravel Route : – Route Parameters

[php]
Route::get(‘product/{id}’, function($id)
{
//return id
return ‘Products ‘.$id;
});
[/php]

Laravel Route – Optional Route Parameters

[php]
Route::get(‘product/{name?}’, function($name = null)
{
//return name
return $name;
});
[/php]

Laravel Route – Optional Route Parameters With Defaults

[php]
Route::get(‘product/{name?}’, function($name = ‘laptop’)
{
//return name
return $name;
});
[/php]

Laravel Route – Regular Expression Route Constraints

[php]
Route::get(‘product/{name}’, function($name)
{
// your PHP some code here with where conditions
})
->where(‘name’, ‘[A-Za-z]+’);

Route::get(‘product/{id}’, function($id)
{
// your PHP some code here with where conditions
})
->where(‘id’, ‘[0-9]+’);
[/php]

Laravel Route – Passing An Array Of Wheres

[php]
Route::get(‘product/{id}/{name}’, function($id, $name)
{
//your PHP some code here with where
})
->where(array(‘id’ => ‘[0-9]+’, ‘name’ => ‘[a-z]+’))
[/php]

Laravel Route – Defining Global Patterns

[php]
//your pattern
Route::pattern(‘id’, ‘[0-9]+’);

READ :  Routing in laravel 6 Web Application Tutorial

//basic routings
Route::get(‘product/{id}’, function($id)
{
// your PHP some code here Like as a Only called if “{id}” is numeric.
});
[/php]

Laravel Route – Accessing A simple Route Parameter Value : use the Route::input method:

[php]
Route::filter(‘home’, function()
{
if (Route::input(‘id’) == 1)
{
// your PHP some code here
}
});
[/php]

Example

I hope you have Got What is difference between laravel get and post route And how it works.I would Like to have FeadBack From My Blog(infinityknow.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(infinityknow.com) Are Most Always Welcome.

Related posts:

  1. Routing in laravel 6 Web Application Tutorial
  2. How to get current route name path and action in laravel 6 ?
  3. Vuejs Simple Navigation Menu vue router-link params
  4. Vuejs Routing routeprovider pass parameters to controller
Technology, Laravel, MySQL Tags:laravel get route name, laravel get route parameters in controller, laravel route api, laravel route controller, laravel route middleware, laravel route parameters, laravel route wildcard, laravel route()

Post navigation

Previous Post: Angular date filter in range Examples
Next Post: Dynamic Metadata In AngularJS ngMeta

Related Posts

  • how to install PHP Accelerator in Xampp
    how to install PHP Accelerator in Xampp Technology
  • jQuery Validate plugin for multiple file upload validation Technology
  • AngularJS Session Storage ngStorage
    AngularJS Session Storage ngStorage Technology
  • Multiple Image Upload in php with Database
    Multiple Image Upload in php with Database Technology
  • Laravel 6 Get All Records Technology
  • vuejs dynamic components – Dynamically add-remove row using vuejs
    vuejs dynamic components – Dynamically add-remove row using vuejs Technology

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Account web hosting (1)
  • AngularJs (277)
  • Articles (143)
  • Asp.Net (49)
  • Astrology (2)
  • Attorney (7)
  • Auto Car Insurance (4)
  • Biography (2)
  • Business (9)
  • Business Insurance (3)
  • California (4)
  • Choose the web hosting (1)
  • Clothing (6)
  • cloud (8)
  • Cloud data storage (2)
  • Credit (1)
  • Dedicated hosting server web (1)
  • Dedicated server web hosting (1)
  • Dedicated web hosting (1)
  • Degree (11)
  • Design (9)
  • Differences shared hosting (1)
  • Donate (2)
  • Education (37)
  • Energy web hosting (1)
  • Entertainment (6)
  • Facts (12)
  • Fashion (3)
  • Finance (3)
  • Food (5)
  • full form (90)
  • Google Adsense (22)
  • Health (20)
  • Home Improvement (5)
  • Insurance (6)
  • Interview (2)
  • Jobs (6)
  • jquery (2)
  • jQuery (2)
  • Laravel (164)
  • Lawyer (4)
  • Lifestyle (6)
  • Loans (6)
  • Make Money (31)
  • Managed dedicated server (1)
  • Managed hosting solution (1)
  • Managed servers (1)
  • Marketing (8)
  • Mortgage (2)
  • Movies (21)
  • MySQL (180)
  • News (5)
  • Photography (1)
  • PHP (250)
  • Programming (18)
  • Quotes (75)
  • Real Estate (2)
  • SEO (9)
  • Shared web hosting (1)
  • Shayari (67)
  • Sports (5)
  • Status (34)
  • Stories (45)
  • suvichar (8)
  • Tech (3)
  • Technology (675)
  • Tips and Tricks (42)
  • Top Tranding (35)
  • Trading (28)
  • Travel (12)
  • Uncategorized (8)
  • VueJs (179)
  • Web Design (2)
  • WEB HOSTING (1)
  • Web hosting company (1)
  • Web hosting really (1)
  • Web hosting windows (1)
  • Which website hosting (1)
  • Wishes (13)
  • wordpress (15)

Categories

AngularJs (277) Articles (143) Asp.Net (49) Attorney (7) Business (9) Clothing (6) cloud (8) Degree (11) Design (9) Education (37) Entertainment (6) Facts (12) Food (5) full form (90) Google Adsense (22) Health (20) Home Improvement (5) Insurance (6) Jobs (6) Laravel (164) Lifestyle (6) Loans (6) Make Money (31) Marketing (8) Movies (21) MySQL (180) News (5) PHP (250) Programming (18) Quotes (75) SEO (9) Shayari (67) Sports (5) Status (34) Stories (45) suvichar (8) Technology (675) Tips and Tricks (42) Top Tranding (35) Trading (28) Travel (12) Uncategorized (8) VueJs (179) Wishes (13) wordpress (15)
  • rdo full form – rdo Kya Hai, Meaning and Abbreviation – What is the full form of rdo? full form
  • Auto insurance quotes Quotes
  • How to send WhatsApp Messages from PHP
    How to send WhatsApp Messages from PHP Technology
  • simple file upload component using VueJs
    simple file upload component using VueJs Technology
  • VueJS String substring() Method Technology
  • How to get Query String from url in Laravel 6? Technology
  • Laravel Dynamically Adding Multiple Columns in datatable server side Technology
  • Redirect page after delay using AngularJS
    Redirect page after delay using AngularJS Technology

Copyright © 2022 InfinityKnow.

Powered by PressBook News WordPress theme