public function postEntryduzenle($id) { $validate = Validator::make(Input::all(), Entry::$rules); $messages = $validate->messages(); if ($validate->fails()) { return Redirect::back()->with(array('mesaj' => 'true', 'title' => 'Doğrulama Hatası', 'text' => '' . $messages->first() . '', 'type' => 'error')); } $entry = Entry::findOrFail($id); $entry->content = Input::get('content'); $entry->save(); if ($entry->save()) { return Redirect::back()->with(array('mesaj' => 'true', 'title' => 'Entry Güncellendi', 'text' => 'Entry Başarı İle Güncellendi', 'type' => 'success')); } else { return Redirect::back()->with(array('mesaj' => 'true', 'title' => 'Entry Güncellenemedi', 'text' => 'Entry Güncellenirken Sorun İle Karşılaşıldı', 'type' => 'error')); } }
/** * Show the form for editing the specified resource. * GET /entries/{id}/edit * * @param int $id * @return Response */ public function edit($id) { $entry = Entry::findOrFail($id); return View::make('entries.edit', compact(['entry'])); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($logbook_id, $entry_id) { $entry = Entry::findOrFail($entry_id); $entry->delete(); return Redirect::to(route('logbooks.show', [$logbook_id]))->with('message', ['content' => 'Entry met succes verwijderd!', 'class' => 'success']); }