samedi 2 novembre 2019

why redirect() doesn't work within if statement , how can i execute it within if statement?? in laravel 5.8

  1. after execute this function i see just white page , no thing
  2. this function for Sorting posts by category , state , municipal.

'''

public function sorting_posts(Request $R){

    if( (!is_null($R->state) AND is_null($R->municipal) ) AND is_null($R->type) ){
      $Posts = Post::latest('created_at')
                     ->where('state_id',$R->state)
                     ->where('category_id',$R->category_id)
                     ->paginate(9);

      return redirect()->route('by.category',$R->category_id)->with('Posts',$Posts);
    }

}

'''



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire