is there any ways that JavaScript can get the variable from compact controller Laravel-5.
Example: I have the code below:
$langs = Language::all()
Is very easy, I use this code:
Controller:
$langs = Language::all()->toArray(); return view('NAATIMockTest.Admin.Language.index', compact('langs'));
View:
hope it has been helpful, regards!