Rewrite assigned to template's variable

#rewrite assigned to template's variable

Route::get('/', function() {
    $ary = ['a', 'b', 'c'];
    $response = new \Illuminate\Http\Response;

    $i = Request::input('i');
    $wall = 'N';
    $view = view('test', ['ary' => $ary, 'wall' => $wall]);
    if ($i == '1') {
        $wall = 'Y';
        $view->with('wall', $wall);
    }
    return $response->create($view);
});

留言