Difference between revisions of "Laravel"

From belajarwiki
Jump to navigation Jump to search
(Created page with "===Instalasi=== ===Pranala Menarik=== * Apache dan MySQL")
 
Line 1: Line 1:
 
===Instalasi===
 
===Instalasi===
  
 +
Pastikan sudah terdapat php yang terinstall.
  
 +
====Install composer====
 +
 +
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
 +
 +
Kemudian cek HASH
 +
 +
HASH=`curl -sS https://composer.github.io/installer.sig`
 +
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
 +
 +
Install composer secara global
 +
 +
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
 +
 +
Cek composer
 +
 +
composer
 +
 +
====Install laravel====
 +
 +
Misal nama foldernya adalah example-app
 +
 +
composer create-project laravel/laravel example-app
 +
 +
Jalankan laravel
 +
 +
cd example-app
 +
php artisan serve --host
 +
 +
Atau dengan IP dan port tertentu
 +
 +
php artisan serve --host <IP> --port <no port>
 +
php artisan serve --host 192.168.1.102 --port 80
  
 
===Pranala Menarik===
 
===Pranala Menarik===
 
* [[Apache dan MySQL]]
 
* [[Apache dan MySQL]]
 +
 +
===Referensi===
 +
* https://laravel.com/docs/10.x
 +
* https://igunawan.com/install-composer-di-ubuntu-20-04/

Revision as of 11:20, 16 March 2023

Instalasi

Pastikan sudah terdapat php yang terinstall.

Install composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

Kemudian cek HASH

HASH=`curl -sS https://composer.github.io/installer.sig`
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

Install composer secara global

sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

Cek composer

composer

Install laravel

Misal nama foldernya adalah example-app

composer create-project laravel/laravel example-app

Jalankan laravel

cd example-app
php artisan serve --host

Atau dengan IP dan port tertentu

php artisan serve --host <IP> --port <no port>
php artisan serve --host 192.168.1.102 --port 80

Pranala Menarik

Referensi