2017-04-06 1 views
0

in route file500 interner Server Fehler, während Ajax Anfrage in Laravel bekommen?

Route::get('griev_reg_form/assembly/{district_id}', '[email protected]'); 

In controller

public function assembly($id){ 
    $assemblyConstituency = AssemblyConstituency::where('dis_code', '=', $id)->orderBy(3)->get(); 
     $options = array(); 

     foreach ($assemblyConstituency as $assembly) { 
      $options += array($assembly->ac_code => $assembly->ac_name); 
     } 

     return Response::json($options); 
    } 

Im Hinblick Datei

$("#district").change(function() { 
      $.getJSON("griev_reg_form/assembly/" + $("#district").val(), function(data) { 
       var $assembly = $("#ac_problem"); 
       $assembly.empty(); 
       $.each(data, function(index, value) { 
        $assembly.append('<option value="' + index +'">' + value + '</option>'); 
       }); 
      // $("#station_id").trigger("change"); /* trigger next drop down list not in the example */ 
      }); 
     }); 

when i change the select box there is error name "HTTP500: SERVER ERROR - The server encountered an unexpected condition that prevented it from fulfilling the request."

+0

haben Sie Ihren Fehler überprüfen Protokolle? Was ist im Fehlerprotokoll und im Zugriffsprotokoll? – Jpsh

+0

kannst du mir bitte sagen, wo ich das sehen kann? –

+0

storage/logs/laravel.log – manniL

Antwort

0

Es ist, weil ich nicht Antwort in den

Controller hinzugefügt habe
use Response; 
Verwandte Themen