mardi 5 novembre 2019

Redirect not working from child function laravel

I have a situation where I need to redirect to some route from the child function.

function pfunction(){
 $value='a';
 $res = $this->childfunction($value);
 if(count($res)>0){
//do stuff
}
}

function childfunction($value){
if(gettype($value)=='object'){
//do stuff
}else{
return Redirect::route('nextroute');
}
}

now when I run the code It gives the error.

"count(): Parameter must be an array or an object that implements Countable".


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire