Sabtu, 03 Januari 2026

Codeigniter Vs Laravel (First content in 2026 in English) #3

Visualizing the file structure is the best way to understand the "weight" of each framework. Laravel comes with many pre-configured folders for modern DevOps, while CodeIgniter keeps things strictly focused on the essentials.

1. Laravel Folder Structure
Laravel is "heavy" because it provides a dedicated place for everything—translations, tests, storage, and configuration.

app/: Contains the core code (Models, Controllers, Providers).
bootstrap/: Used for framework optimization and cache.
config/: Every setting (database, mail, services) has its own file here.
database/: Dedicated folders for Migrations (schema) and Factories (dummy data).
public/: The entry point for the server; contains assets like CSS/JS.
resources/: Where your Blade templates and raw SASS/Vite files live.
routes/: Clear separation between web.php and api.php.

storage/: Where logs, file uploads, and framework-generated cache are kept.

2. CodeIgniter 4 Folder Structure
CodeIgniter follows a much more compact, "Lean" approach. If you know where the app folder is, you know 90% of the framework.

app/: This is where you spend all your time. It contains Controllers, Models, and Views.
public/: Similar to Laravel, this is the only folder visible to the outside world.
system/: The core framework engine. Never touch this. It's separated so you can update the framework easily.
writable/: The equivalent of Laravel’s storage; used for logs and uploads.
tests/: Basic setup for unit and inspection tests.

The Main Difference in Organization
Laravel encourages Modularization. It assumes you will use external tools like Redis, Pusher, and Mailgun, so it gives you a configuration file for each one immediately.

CodeIgniter encourages Simplicity. It assumes you want to get a database connection and a view running as quickly as possible without navigating through 20 different folders.

-Saya pasti pulang-
Share:

0 komentar:

Posting Komentar