Blog - RESTful Resource Controller
route to the controller Blog
Route::resource('blog', 'BlogController');
Simple query does not work
$http.delete('/blog/1');
return
403 Forbidden
POST(store), GET (index, show), requests work
delete (destroy) does not work
$http.post('/blog/1', {_method: 'DELETE'});
return
405 Method Not Allowed
<?php
class BlogController extends \BaseController {
public function index()
{
return Blog::orderBy('id')->get();
}
public function store()
{
....
....
}
public function edit($id)
{
return Blog::find($id);
}
public function destroy($id)
{
Blog::destroy($id);
}
}