Can't seem to get redirect working

Posted 2 years ago by jason100

I have this code snippet

foreach($arrDocs as $arrDoc){
    if(!$Page){
                echo "^".$arrDoc."^";  // <-this does get called
            redirect("/doc/$arrDoc");
    }

calling this route:

Route::get('/doc/{docname}', 'Employment\[email protected]');

which calls this function:

public function docList(Request $request,$docname){
        die($docname);
}

but the "die($docname);" line never seems to get called

What am I doing wrong?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.