I would like to send information from one function to another using a function ->with(key, val), but it does not work. I tried a lot of things, but this does not work.
Here is my actual setup (I am using laravel 5.2):
routes.php
Route::group(['middleware' => ['web']], function() {
Route::get("/test1", "InfoController@test1");
Route::get("/test2", "InfoController@test2");
});
InfoController.php
class InfoController extends Controller
{
public function test1(){
return View::make("infos");
}
public function test2(){
return Redirect::to("/test1")->with("hello", "world");
}
}
Infos.blade.php
{{\Illuminate\Support\Facades\Session::get("hello")}}
Sit blank → no output.
Where is the problem?
source
share