public function updateTextblock(Request $request, $textblockId) { $textblock = Textblock::findOrFail($textblockId); $textblock->update(['content' => $request->get('content')]); return redirect('package-edible/pages/' . $textblock->page->id); }
protected function notSeeInDatabase($table, $attributes) { switch ($table) { case 'ec_pages': $q = null; foreach ($attributes as $key => $value) { if (is_null($q)) { $q = Page::where($key, $value); } else { $q = $q->where($key, $value); } } $this->assertCount(0, $q->get()); break; case 'ec_textblocks': $q = null; foreach ($attributes as $key => $value) { if (is_null($q)) { $q = Textblock::where($key, $value); } else { $q = $q->where($key, $value); } } $this->assertCount(0, $q->get()); break; case 'ec_galleries': $q = null; foreach ($attributes as $key => $value) { if (is_null($q)) { $q = Gallery::where($key, $value); } else { $q = $q->where($key, $value); } } $this->assertCount(0, $q->get()); break; default: # code... break; } }