I am new to restful api,and I met a problem,problem is :when I request destroy with delete method and store with post method,both will return 500 error.But I use get method to request index and show,both are ok.What is the problem? Here is my codes and request:
delete http://ift.tt/24jCHiZ
get http://ift.tt/24jCHiZ
post http://ift.tt/25BMzdP
class CustomersController extends Controller
{
public function index(){
$customersInfo = customers::all();
return $customersInfo;
}
public function show($cust_id){
$customer = customers::where('cust_id',$cust_id)->first();
return $customer;
}
public function store()
{
echo "store";
}
public function destroy()
{
return "success";
}
}
Route::resource('customers','CustomersController');
if any one can help me ,I'd appreciate it!Thanks in advanced!
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/24jD11e
via IFTTT
Aucun commentaire:
Enregistrer un commentaire