I got this error when i tried to make a crud program on Laravel
Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message
my code :
public function update(Request $request){
DB::table('berita')->where('id_berita',$request->id)->update([
'judul' => $request->judul,
'isi_berita' => $request->isi,
]);
return redirect('/berita');
}
There is my Routes :
<?php
Route::get('/index', function () {
return view('index');
});
Route::get('/', function () {
return view('index');
});
Route::get('halo', function () {
return "Halo, Selamat datang di Web Jurusan RPL SMKN 2 Subang";
});
//route CRUD
Route::get('/berita','InputController@index');
Route::get('/berita', function(){
return view('berita');
});
Route::get('/galeri', function(){
return view('galeri');
});
Route::get('/post-add', function(){
return view('post-add');
});
Route::post('ckeditor/image_upload', 'CKEditorController@upload')->name('upload');
Route::get('/berita','InputController@index');
Route::post('/post-add/save','InputController@store');
Route::get('/berita/hapus/{id}','InputController@delete');
Route::get('/berita/edit/{id}','InputController@edit');
Route::get('/berita/update','InputController@update');
?>
I need ur help.
Help me to solve this T_T
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2UaidPa
via IFTTT
Aucun commentaire:
Enregistrer un commentaire