Membuat CRUD CodeIgniter 4 #1: Instalasi Awal

CRUD CodeIgniter 4 Dasar

Membuat CRUD CodeIgniter 4 - Ini adalah panduan dasar bagaimana cara membuat aplikasi CRUD (Create, Read, Update dan Delete) menggunakan framework CodeIgniter 4.

Dalam artikel ini sebagai contoh kita akan membuat program untuk menampilkan data siswa. Dimana disini saya menggunakan sistem operasi Linux.

Untuk server dan mysql, saya gunakan xampp. Jika anda butuh panduan bagaimana cara instalasinya di Ubuntu Linux, silahkan baca disini.

Hal yang pertama kali harus dilakukan adalah melakukan instalasi Composer, agar paket dapat didownload dengan mudah hanya melalui terminal.


1. Install Composer

Caranya adalah buka terminal lalu gunakan perintah tersebut:

sudo apt update
sudo apt install composer

Setelah composer berhasil diinstall, maka selanjuatnya adalah...


2. Install Paket CodeIgniter

Saya ingin projek codeigniter nanti berada di foler "Documents/Project-CI4". Maka buatkan dahulu folder Project-CI4 didalam Document. Dan untuk nama project kita nanti adalah crud_basic. Setelah itu, m-CI4.

cd /Documents/Project-CI4
composer create-project codeigniter4/appstarter crud_basic

Jika berhasil anda akan melihat seperti berikut:

neon@neon:~/Documents/Project-CI4$ composer create-project codeigniter4/appstarter crud_basic
Creating a "codeigniter4/appstarter" project at "./crud_basic"
Installing codeigniter4/appstarter (v4.1.5)
  - Downloading codeigniter4/appstarter (v4.1.5)
  - Downloading codeigniter4/appstarter (v4.1.5)
  - Installing codeigniter4/appstarter (v4.1.5): Extracting archive
Created project in /home/neon/Documents/Project-CI4/crud_basic
Loading composer repositories with package information
Updating dependencies
Lock file operations: 42 installs, 0 updates, 0 removals
  - Locking codeigniter4/framework (v4.1.5)
  - Locking doctrine/instantiator (1.4.0)
  - Locking fakerphp/faker (v1.17.0)
  - Locking kint-php/kint (3.3)
  - Locking laminas/laminas-escaper (2.9.0)
  - Locking mikey179/vfsstream (v1.6.10)
  - Locking myclabs/deep-copy (1.10.2)
  - Locking nikic/php-parser (v4.13.2)
  - Locking phar-io/manifest (2.0.3)
  - Locking phar-io/version (3.1.0)
  - Locking phpdocumentor/reflection-common (2.2.0)
  - Locking phpdocumentor/reflection-docblock (5.3.0)
  - Locking phpdocumentor/type-resolver (1.5.1)
  - Locking phpspec/prophecy (1.14.0)
  - Locking phpunit/php-code-coverage (9.2.10)
  - Locking phpunit/php-file-iterator (3.0.6)
  - Locking phpunit/php-invoker (3.1.1)
  - Locking phpunit/php-text-template (2.0.4)
  - Locking phpunit/php-timer (5.0.3)
  - Locking phpunit/phpunit (9.5.10)
  - Locking psr/container (2.0.2)
  - Locking psr/log (1.1.4)
  - Locking sebastian/cli-parser (1.0.1)
  - Locking sebastian/code-unit (1.0.8)
  - Locking sebastian/code-unit-reverse-lookup (2.0.3)
  - Locking sebastian/comparator (4.0.6)
  - Locking sebastian/complexity (2.0.2)
  - Locking sebastian/diff (4.0.4)
  - Locking sebastian/environment (5.1.3)
  - Locking sebastian/exporter (4.0.4)
  - Locking sebastian/global-state (5.0.3)
  - Locking sebastian/lines-of-code (1.0.3)
  - Locking sebastian/object-enumerator (4.0.4)
  - Locking sebastian/object-reflector (2.0.4)
  - Locking sebastian/recursion-context (4.0.4)
  - Locking sebastian/resource-operations (3.0.3)
  - Locking sebastian/type (2.3.4)
  - Locking sebastian/version (3.0.2)
  - Locking symfony/deprecation-contracts (v3.0.0)
  - Locking symfony/polyfill-ctype (v1.23.0)
  - Locking theseer/tokenizer (1.2.1)
  - Locking webmozart/assert (1.10.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 42 installs, 0 updates, 0 removals
  - Downloading psr/log (1.1.4)
  - Downloading laminas/laminas-escaper (2.9.0)
  - Downloading kint-php/kint (3.3)
  - Downloading codeigniter4/framework (v4.1.5)
  - Downloading symfony/deprecation-contracts (v3.0.0)
  - Downloading psr/container (2.0.2)
  - Downloading fakerphp/faker (v1.17.0)
  - Downloading mikey179/vfsstream (v1.6.10)
  - Downloading symfony/polyfill-ctype (v1.23.0)
  - Downloading webmozart/assert (1.10.0)
  - Downloading phpdocumentor/reflection-common (2.2.0)
  - Downloading phpdocumentor/type-resolver (1.5.1)
  - Downloading phpdocumentor/reflection-docblock (5.3.0)
  - Downloading sebastian/version (3.0.2)
  - Downloading sebastian/type (2.3.4)
  - Downloading sebastian/resource-operations (3.0.3)
  - Downloading sebastian/recursion-context (4.0.4)
  - Downloading sebastian/object-reflector (2.0.4)
  - Downloading sebastian/object-enumerator (4.0.4)
  - Downloading sebastian/global-state (5.0.3)
  - Downloading sebastian/exporter (4.0.4)
  - Downloading sebastian/environment (5.1.3)
  - Downloading sebastian/diff (4.0.4)
  - Downloading sebastian/comparator (4.0.6)
  - Downloading sebastian/code-unit (1.0.8)
  - Downloading sebastian/cli-parser (1.0.1)
  - Downloading phpunit/php-timer (5.0.3)
  - Downloading phpunit/php-text-template (2.0.4)
  - Downloading phpunit/php-invoker (3.1.1)
  - Downloading phpunit/php-file-iterator (3.0.6)
  - Downloading theseer/tokenizer (1.2.1)
  - Downloading nikic/php-parser (v4.13.2)
  - Downloading sebastian/lines-of-code (1.0.3)
  - Downloading sebastian/complexity (2.0.2)
  - Downloading sebastian/code-unit-reverse-lookup (2.0.3)
  - Downloading phpunit/php-code-coverage (9.2.10)
  - Downloading doctrine/instantiator (1.4.0)
  - Downloading phpspec/prophecy (1.14.0)
  - Downloading phar-io/version (3.1.0)
  - Downloading phar-io/manifest (2.0.3)
  - Downloading myclabs/deep-copy (1.10.2)
  - Downloading phpunit/phpunit (9.5.10)
  - Installing psr/log (1.1.4): Extracting archive
  - Installing laminas/laminas-escaper (2.9.0): Extracting archive
  - Installing kint-php/kint (3.3): Extracting archive
  - Installing codeigniter4/framework (v4.1.5): Extracting archive
  - Installing symfony/deprecation-contracts (v3.0.0): Extracting archive
  - Installing psr/container (2.0.2): Extracting archive
  - Installing fakerphp/faker (v1.17.0): Extracting archive
  - Installing mikey179/vfsstream (v1.6.10): Extracting archive
  - Installing symfony/polyfill-ctype (v1.23.0): Extracting archive
  - Installing webmozart/assert (1.10.0): Extracting archive
  - Installing phpdocumentor/reflection-common (2.2.0): Extracting archive
  - Installing phpdocumentor/type-resolver (1.5.1): Extracting archive
  - Installing phpdocumentor/reflection-docblock (5.3.0): Extracting archive
  - Installing sebastian/version (3.0.2): Extracting archive
  - Installing sebastian/type (2.3.4): Extracting archive
  - Installing sebastian/resource-operations (3.0.3): Extracting archive
  - Installing sebastian/recursion-context (4.0.4): Extracting archive
  - Installing sebastian/object-reflector (2.0.4): Extracting archive
  - Installing sebastian/object-enumerator (4.0.4): Extracting archive
  - Installing sebastian/global-state (5.0.3): Extracting archive
  - Installing sebastian/exporter (4.0.4): Extracting archive
  - Installing sebastian/environment (5.1.3): Extracting archive
  - Installing sebastian/diff (4.0.4): Extracting archive
  - Installing sebastian/comparator (4.0.6): Extracting archive
  - Installing sebastian/code-unit (1.0.8): Extracting archive
  - Installing sebastian/cli-parser (1.0.1): Extracting archive
  - Installing phpunit/php-timer (5.0.3): Extracting archive
  - Installing phpunit/php-text-template (2.0.4): Extracting archive
  - Installing phpunit/php-invoker (3.1.1): Extracting archive
  - Installing phpunit/php-file-iterator (3.0.6): Extracting archive
  - Installing theseer/tokenizer (1.2.1): Extracting archive
  - Installing nikic/php-parser (v4.13.2): Extracting archive
  - Installing sebastian/lines-of-code (1.0.3): Extracting archive
  - Installing sebastian/complexity (2.0.2): Extracting archive
  - Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
  - Installing phpunit/php-code-coverage (9.2.10): Extracting archive
  - Installing doctrine/instantiator (1.4.0): Extracting archive
  - Installing phpspec/prophecy (1.14.0): Extracting archive
  - Installing phar-io/version (3.1.0): Extracting archive
  - Installing phar-io/manifest (2.0.3): Extracting archive
  - Installing myclabs/deep-copy (1.10.2): Extracting archive
  - Installing phpunit/phpunit (9.5.10): Extracting archive
9 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files
28 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Sekarang, buka folder crud_basic menggunakan kode Editor yang anda miliki. Disini saya menggunakan VSCode. Maka akan terlihat seperti ini:

Membuat CRUD CodeIgniter 4 #1: Instalasi Awal

Selanjutnya kiata akan membuat database dan migration.

Posting Komentar

Komentar anda sedang di moderasi oleh Admin. Mohon tunggu. Terima kasih.

Lebih baru Lebih lama

Formulir Kontak