// HTML view
return view("posts/index", ["posts"=>$posts]);
// JSON
return $this->response->setStatusCode(201)->setJSON(["id"=>$id]);
// Redirect with flash
return redirect()->to("/posts")->with("success","Saved!");
// Redirect back with errors
return redirect()->back()->withInput()->with("errors", $this->validator->getErrors());