How to retrieve a value in a route from a controller

Posted 2 years ago by Baptiste

Hello to you,

I have a view or I list my games and I have a button that allows me To access the forum according to the games :

   a style="float:left" class="btn btn-danger" href="{{route('sujet.index'$jeu->id)}}">Forum</a>

I need to recover the value at the end of my url so 1 in this context in order to be able to reference the forum according to the game but since my controller how can I do?

Http:// localhost/multigaming/public/subject?1

Here is the subject index:

    public function index() {  
   
    $lesSujets = Sujet::paginate(20);    
    return view('sujet/index', compact('lesSujets'));
     
    } 

 

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