Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions core/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,6 @@

class App
{
protected static Container $container;

public function __construct(Container $container)
{
static::$container = $container;
}

/**
* Get the service container.
*/
public static function container(): Container
{
return static::$container;
}

/**
* The shared service container instance.
* @var Container
Expand Down
11 changes: 0 additions & 11 deletions core/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@

class Response
{
protected mixed $content;
protected int $statusCode;
protected array $headers;

public function __construct(mixed $content = '', int $statusCode = 200, array $headers = [])
{
$this->content = $content;
$this->statusCode = $statusCode;
$this->headers = $headers;
}

/**
* The response content.
* @var mixed
Expand Down
7 changes: 3 additions & 4 deletions docs/GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,16 @@ class PostController extends Controller
}

// Lưu dữ liệu từ form tạo mới
public function store(Request $request): void
public function store(Request $request): Response
{
$post = new Post();
$post->create([
'title' => $request->get('title'),
'content' => $request->get('content'),
]);

// Chuyển hướng về trang danh sách
header('Location: /posts');
exit();
// Trả về một Response để chuyển hướng về trang danh sách
return Response::create('', 302, ['Location' => '/posts']);
}

// ... (Các phương thức edit, update, destroy sẽ tương tự)
Expand Down
Loading