0

I want to access a controller function from blade file in laravel.

My Code:

Blade.php

use App\Http\Controllers\myController;
$newControl = new myController;

$function = 'myfunction()';

echo $newControl->$function;
Jeremy Harris
  • 24,318
  • 13
  • 79
  • 133
  • 3
    Possible duplicate of [How to call a controller function inside a view in laravel 5](https://stackoverflow.com/questions/35332784/how-to-call-a-controller-function-inside-a-view-in-laravel-5) – Jeremy Harris Oct 30 '19 at 12:01
  • There's probably another issue here which is that you shouldn't put such logic in your view. Your controller should be the one to call these functions. – Flame Oct 30 '19 at 15:14
  • then how to call the function because use dynamic – Gurumoorthy Dhanabal Oct 31 '19 at 04:25

0 Answers0