jeudi 1 mars 2018

Laravel get data from dropdown list and pass it to the controller

I am trying to have the user choose a month from a dropdown list displaying the months, and passes that month value (in numbers) to the controller I am having trouble making the dropdown list an action so once the user picks the month, the controller gets called.

here is my index page:

  <h>Display a logs by monthly <h>
    
    <a href=""  class="btn btn-primary">Monthly Logs
      </a>

and when I add the Form method inside the tag i am getting an error says the variable is not defined.

here is the Controller.php

 public function monthly($id)
 {
     $dcmlogs = log::with('users')
     ->whereMonth('created_at', '=', $id)
     ->paginate(15);
    return view('dcmlog.index', compact('dcmlogs'));
}



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2HS9M2e
via IFTTT

Aucun commentaire:

Enregistrer un commentaire