Skip to content

Commit a5dd7db

Browse files
Update installation instructions in README, modify post-create commands in composer.json, and add Update command for application updates
1 parent f5ea524 commit a5dd7db

File tree

3 files changed

+47
-18
lines changed

3 files changed

+47
-18
lines changed

README.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,10 @@ Rekomendasi shared hosting murah:
5151
- Hapus seluruh folder dan file yang ada di root domain.
5252
- Connect via terminal menggunakan SSH.
5353
- Arahkan ke folder root domain.
54-
- Clone Simpede Repository:
54+
- Jalankan Command:
5555
```bash
56-
git clone https://github.com/laravelwebdev/simpede.git .
56+
composer create-project laravelwebdev/simpede . --no-dev
5757
```
58-
- Buat symlink dari public_html
59-
```bash
60-
ln -s public public_html
61-
```
62-
63-
- Update dependencies (gunakan composer2):
64-
```bash
65-
composer2 update --no-dev
66-
```
67-
6858
- Rename file `.env.example` menjadi `.env` dan edit variabel berikut:
6959
* `APP_URL`: URL website.
7060
* `DB_HOST`: Host database, biasanya `localhost`.
@@ -78,10 +68,7 @@ Rekomendasi shared hosting murah:
7868
* `INITIAL_YEAR`: set menjadi tahun pertama aplikasi digunakan
7969

8070
- Ubah seluruh setting di bagian `# CONFIG SATKER` pada file `.env` sesuai dengan satker Anda.
81-
- Generate Key:
82-
```bash
83-
php artisan key:generate
84-
```
71+
8572
- Lakukan migrasi database:
8673
```bash
8774
php artisan migrate --seed
@@ -120,3 +107,13 @@ Aplikasi ini menggunakan Whatsapp API dari [Fonnte](https://fonnte.com) agar bis
120107
Aplikasi ini menggunakan website [Sentry](https://sentry.io/) sebagai sarana untuk memonitor error dan performa.
121108
- Ubah setting Sentry pada file `.env`
122109
* `SENTRY_LARAVEL_DSN`: Isi DSN Sentry yang anda miliki.
110+
111+
## Mengupdate Aplikasi
112+
Untuk mengupdate aplikasi jalankan command:
113+
```bash
114+
php artisan app:update
115+
```
116+
atau jika menggunakan composer2
117+
```bash
118+
php artisan app:update --composer=composer2
119+
```

app/Console/Commands/Update.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace App\Console\Commands;
4+
5+
use Illuminate\Console\Command;
6+
7+
class Update extends Command
8+
{
9+
/**
10+
* The name and signature of the console command.
11+
*
12+
* @var string
13+
*/
14+
protected $signature = 'app:update {--composer=composer}';
15+
16+
/**
17+
* The console command description.
18+
*
19+
* @var string
20+
*/
21+
protected $description = 'Update the application';
22+
23+
/**
24+
* Execute the console command.
25+
*/
26+
public function handle()
27+
{
28+
exec('git pull origin main', $output, $return_var);
29+
$composer = $this->option('composer');
30+
exec("$composer update --no-dev", $output, $return_var);
31+
}
32+
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
],
6767
"post-create-project-cmd": [
6868
"@php artisan key:generate --ansi",
69-
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
70-
"@php artisan migrate --graceful --ansi"
69+
"ln -s public public_html",
70+
"php artisan storage:link"
7171
]
7272
},
7373
"extra": {

0 commit comments

Comments
 (0)