id}"; if (Input::has('reset')) { session()->forget($session_key); } /** @var Changeset $changeset */ return session()->remember($session_key, function () use ($table) { $changeset = new Changeset(); $changeset->table = $table; $changeset->revision = $table->revision; return $changeset; }); } public function draft(User $user, string $table, $tab = null) { /** @var Table $tableModel */ $tableModel = $user->tables()->where('name', $table)->first(); if ($tableModel === null) abort(404, "No such table."); if ($tab == null) $tab = 'edit-rows'; $tabs = ['edit-rows', 'add-rows', 'manage-columns', 'review']; if (!in_array($tab, $tabs)) abort(404, "No such tab: $tab"); $changeset = $this->getChangeset($tableModel); return $this->{camel_case($tab)}($changeset); } private function editRows(Changeset $changeset) { $revision = $changeset->revision; $columns = $changeset->transformColumns(); $rows = $revision->rowsData($columns, true, false)->paginate(25, []); return view('table.propose.edit-rows', [ 'changeset' => $changeset, 'table' => $changeset->table, 'columns' => collect($columns), 'rows' => $rows, ]); } }