public function destroy($id) { if (!Book::destroy($id)) { return Redirect::back(); } return Redirect::route('admin.books.index')->withPesan('Berhasil menghapus buku'); }
/** * Process book deletion * * @return Redirect */ public function postDelete() { try { $book = Book::findOrFail(Input::get('id')); } catch (exception $e) { return Redirect::to('/book/')->with('flash_message', 'Could not delete book - not found.'); } Book::destroy(Input::get('id')); return Redirect::to('/book/')->with('flash_message', 'Book deleted.'); }
public static function deleteBook($id) { $book = new Book(array('id' => $id)); $book->destroy(); Redirect::to('/allbooks', array('message' => 'Kirja on poistettu onnistuneesti!')); }
public static function destroy($id) { $book = new Book(array('id' => $id)); $book->destroy(); Redirect::to('/book', array('Kirja poistettu valikoimastasi.')); }