Passing two variables through a route

Posted 2 months ago by Trikucian

I am trying to pass two variables through the route that are then used in an if/else statement in the controller. When I try the following code I get an error saying that only 1 variable is detected from the view, not 2. What am I missing?

View (I know something about this routing is wrong, but not sure what):

ajax: '{{ route('this.conditions-datatable', $variable->id, true) }}'

note: "true" is referring to the value of the boolean variable I'm trying to pass into the controller.

Controller

    public function conditionsDatatable($variable_id, $boolean) {
       
    if($boolean == false) {
       //code goes here
    } else  if($boolean == true)  {
        //code goes here
    }

Thanks for any help!

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

Reply to

Use Markdown with GitHub-flavored code blocks.