public function delete_item($board_key, $c_id)
 {
     $table = $this->getTable($board_key);
     if (!$table) {
         abort(404);
     }
     $c = Comment::fromTable($table)->find($c_id);
     $this->authorize('sboard-edit', $c);
     $c->delete();
     return redirect("sboards/{$board_key}/{$c->post_id}");
 }
Ejemplo n.º 2
0
 public function comments()
 {
     $table = $this->getTable() . '_comments';
     $instance = Comment::fromTable($table);
     return new HasMany($instance->newQuery(), $this, $instance->getTable() . '.post_id', $this->getKeyName());
 }