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
  • vuejs Form Validation Vuelidate Example Technology
  • Angularjs cookie Set Cookie Get Cookie Delete Cookie Example
    Angularjs cookie Set Cookie Get Cookie Delete Cookie Example Technology
  • Sad shayari Shayari
  • i love you shayari Shayari
  • smps full form – smps Kya Hai, Meaning and Abbreviation – What is the full form of smps? full form
  • Quotes about life Quotes
  • Best suvichar in gujarati suvichar
  • Angularjs Inline Edit example – AngularJs update and save table Row Examples
    Angularjs Inline Edit example – AngularJs update and save table Row Examples Technology

Laravel 6 Call controller method from another controller

Posted on December 18, 2019 By admin No Comments on Laravel 6 Call controller method from another controller

Today, We want to share with you Laravel 6 Call controller method from another controller.In this post we will show you wordpress plugin require another plugin, hear for Laravel 6 how to call a function from another controller we will give you demo and example for implement.In this post, we will learn about How do I call a controller function from another controller in laravel 6? with an example.

Laravel 6 Call controller method from another controller

There are the Following The simple About Access Controller method from another controller in Laravel 6 Full Information With Example and source code.

As I will cover this Post with live Working example to develop How to call model function from another model in Laravel 6?, so the laravel call controller method from another method is used for this example is following below.

READ :  how to install PHP Accelerator in Xampp

How to use external classes and PHP files in Laravel 6 Controller?

Access your controller method
[php]
app(‘App\Http\Controllers\CricketerController’)->getScoreReport();
[/php]

[php]
app()->call(‘App\Http\Controllers\[email protected]’);
[/php]

Laravel controller method has parameters you can pass
[php]
app()->call(‘App\Http\Controllers\[email protected]’, [$team_id, $player_id]);
[/php]

Example 1: Use an external class in Controller
[php]
class CricketerClass {
public function getRuns() {
return [‘test’ => 50, ‘oneday’ => 100, ‘t20’ => 150];
}
}
[/php]

within \App folder

make a separate one – like App\Libraries, App\Classes or App\Services

2. using Laravel Namespace within the file
[php]
namespace App\Classes;

class CricketerClass {
// …
[/php]

3.use in Laravel Controller
[php]
namespace App\Http\Controllers;

use App\Classes\CricketerClass;

class DetailsController extends Controller
{
/**
* Display homepage.
*
* @return Response
*/
public function getHome()
{
$cricketerClass = new CricketerClass();
$runs = $cricketerClass->getRuns();
return view(‘cricketer.details’, compact(‘runs’));
}

READ :  AngularJS AutoComplete Search Dynamic Data using Web API

}
[/php]

Web Programming Tutorials Example with Demo

Read :

  • Jobs
  • Make Money
  • Programming

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about how to use one controller method in another controller laravel.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Related posts:

  1. Vuejs Simple Navigation Menu vue router-link params
  2. Call to undefined function str_slug() in Laravel 6
  3. Responsive Navigation Menu CSS Free download
  4. vuejs toggle class – vue js v-class – Dynamic Components in Vuejs
READ :  Remove Duplicates value from Array using AngularJS
Technology, Laravel, MySQL, PHP Tags:Access Controller method from another controller in Laravel 6, call controller method from another controller codeigniter, call controller method from another controller mvc, How do I call a controller function from another controller in laravel 6?, How to call model function from another model in Laravel 6?, how to call model function from model in Laravel 6, how to use one controller method in another controller laravel, Laravel 6 call model function from another model, Laravel 6 call model function from controller, Laravel 6 call model function from model, laravel 6 create controller, Laravel 6 how to call a function from another controller, laravel call another method in same controller, laravel call controller method from another method, laravel call function from another class, laravel forward request to another controller

Post navigation

Previous Post: jQuery Validate plugin for multiple file upload validation
Next Post: Eloquent Dynamic Table name using Laravel 6

Related Posts

  • Angular Material Autocomplete input textbox – md-autocomplete example
    Angular Material Autocomplete input textbox – md-autocomplete example Technology
  • ngTouch event example using angularjs-ngtouch directive
    ngTouch event example using angularjs-ngtouch directive Technology
  • Difference Between String and Stringbuilder using C# Technology
  • Vuejs Simple Tooltip Plugin v-tooltip Example
    Vuejs Simple Tooltip Plugin v-tooltip Example Technology
  • Angularjs math expression – number expressions Example
    Angularjs math expression – number expressions Example Technology
  • Laravel 6 – increment or decrement column value example 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)
  • Basic Laravel 6 Eloquent Search Techniques Technology
  • VueJS MVC Application Architecture – VueJS model view controller example
    VueJS MVC Application Architecture – VueJS model view controller example Technology
  • vuejs bootstrap datepicker and timepicker Examples
    vuejs bootstrap datepicker and timepicker Examples Technology
  • Outdoor Table Tennis Table
    Pro Tips to Buy an Outdoor Table Tennis Table Articles
  • Angular Top 10 Example for Beginners Technology
  • Top SEO Companies/Agencies in the World
    Top SEO Companies/Agencies in the World Technology
  • Laravel Has Many Through Eloquent Relationship Example
    Laravel Has Many Through Eloquent Relationship Example Technology
  • preschool playground equipment
    Plan Your Playground with Preschool Playground Equipment the Right Way! Sports

Copyright © 2022 InfinityKnow.

Powered by PressBook News WordPress theme