I'm doing a RestFul API with Laravel, and everything goes well with the methods, except the method update()
and the method destroy()
, ( PUT
and DELETE
respectively), it's not a problem of CORS
, if it enters the function and that verifies that when using the respective verbs HTTP
enters the corresponding function, only that it is not executing what is done inside it
I leave the code
<?php namespace App\Http\Controllers; use App\Client; use Illuminate\Http\Request; use App\Http\Requests; use Illuminate\Support\Facades\Input; class ClientController extends Controller { // public function index() { return Client::paginate(5); } public function store() { return Client::create(Input::all()); } public function show($id) { return Client::findOrFail($id); } public function update($id) { Client::findOrFail($id)->update(Input::all()); return Client::findOrFail($id); } public function destroy($id) { $deleted = Client::findOrFail($id); Client::findOrFail($id)->delete(); return $deleted; } }
and here the code of my route.php
Route::resource('clients', 'ClientController');