Created
June 1, 2020 16:17
-
-
Save infinitbility/042c9c38294be2fd4567dbfe5526ddfe to your computer and use it in GitHub Desktop.
Revisions
-
infinitbility created this gist
Jun 1, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ <?php namespace App\Http\Controllers; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Http\Controllers\ChildController; class ParentController extends Controller { protected $ChildController; public function __construct(ChildController $ChildController) { $this->ChildController = $ChildController; } /** * Parent function using child function */ function calc(Request $Request){ $firstNumber = $Request->input('firstNumber'); $operator = $Request->input('operator'); $secondnumber = $Request->input('secondnumber'); $response = $this->ChildController->Calculation($firstNumber, $operator, $secondnumber); return $response; } }