diff --git a/app/Console/Commands/AdminSetup.php b/app/Console/Commands/AdminSetup.php new file mode 100644 index 0000000..1800112 --- /dev/null +++ b/app/Console/Commands/AdminSetup.php @@ -0,0 +1,122 @@ +info('.env berhasil dibuat dari .env.example'); + } + + $dbConnection = $this->choice( + 'Pilih database yang digunakan', + ['mysql', 'pgsql', 'sqlite'], + 1 // default pgsql + ); + + $dbHost = $this->ask('Masukkan IP Address / Host', '127.0.0.1'); + $dbPort = $this->ask( + 'Masukkan Port Database', + $dbConnection === 'mysql' ? '3306' : '5432' + ); + $dbDatabase = $this->ask('Masukkan Nama Database', 'parkir'); + $dbUsername = $this->ask('Masukkan Username Database', 'postgres'); + $dbPassword = $this->secret('Masukkan Password Database'); + + $env = file_get_contents($envFile); + + $replacements = [ + 'APP_DEBUG' => 'true', + 'DB_CONNECTION' => $dbConnection, + 'DB_HOST' => $dbHost, + 'DB_PORT' => $dbPort, + 'DB_DATABASE' => $dbDatabase, + 'DB_USERNAME' => $dbUsername, + 'DB_PASSWORD' => $dbPassword, + ]; + + foreach ($replacements as $key => $value) { + $env = preg_replace( + "/^{$key}=.*/m", + "{$key}={$value}", + $env + ); + } + + file_put_contents($envFile, $env); + + $this->info('Konfigurasi .env berhasil diperbarui.'); + + $this->newLine(); + + $this->table( + ['Key', 'Value'], + [ + ['DB_CONNECTION', $dbConnection], + ['DB_HOST', $dbHost], + ['DB_PORT', $dbPort], + ['DB_DATABASE', $dbDatabase], + ['DB_USERNAME', $dbUsername], + ] + ); + + $this->newLine(); + + if ($this->confirm('Jalankan php artisan key:generate?', true)) { + Artisan::call('key:generate'); + $this->line(Artisan::output()); + } + + // if ($this->confirm('Jalankan php artisan migrate?', false)) { + // Artisan::call('migrate', ['--force' => true]); + // $this->line(Artisan::output()); + // } + + if ($this->confirm('Jalankan php artisan config:clear?', true)) { + Artisan::call('config:clear'); + $this->line(Artisan::output()); + } + + if ($this->confirm('Jalankan php artisan cache:clear?', true)) { + Artisan::call('cache:clear'); + $this->line(Artisan::output()); + } + + $this->info('Setup selesai.'); + + return Command::SUCCESS; + } +} diff --git a/app/Http/Controllers/Api/V1/DisplayContentController.php b/app/Http/Controllers/Api/V1/DisplayContentController.php new file mode 100644 index 0000000..fb0c7ba --- /dev/null +++ b/app/Http/Controllers/Api/V1/DisplayContentController.php @@ -0,0 +1,43 @@ +json([ + // "id" => 1, + // "type" => 'image', + // 'content' => [ + // url($path . '1.jpg'), + // url($path . '2.jpg'), + // url($path . '3.jpg'), + // url($path . '4.jpg'), + // url($path . '5.jpg'), + // ] + // ]); + + $path = 'assets/content/display_content/video/'; + + return response()->json([ + "id" => 1, + "type" => 'video', + 'content' => [ + // "display_1" => url($path . '1.mp4'), + // "display_2" => url($path . '2.mp4'), + // "display_3" => url($path . '3.mp4'), + // url($path . '1.mp4'), + url($path . 'video_2bak.mp4'), + url($path . 'video_3bak.mp4'), + // url($path . 'new_3.mp4'), + // url($path . 'new_4.mp4'), + // url($path . 'new_5.mp4'), + ] + ]); + } +} diff --git a/database/migrations/2026_06_07_062056_create_softseting_displaycontent.php b/database/migrations/2026_06_07_062056_create_softseting_displaycontent.php new file mode 100644 index 0000000..9ac9d37 --- /dev/null +++ b/database/migrations/2026_06_07_062056_create_softseting_displaycontent.php @@ -0,0 +1,35 @@ +id(); + $table->integer('screen_id'); + $table->string('type'); + $table->string('filename'); + $table->integer('duration'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('softseting_displaycontent'); + } +}; diff --git a/public/assets/content/display_content/image/1.jpg b/public/assets/content/display_content/image/1.jpg new file mode 100644 index 0000000..32adb2e Binary files /dev/null and b/public/assets/content/display_content/image/1.jpg differ diff --git a/public/assets/content/display_content/image/2.jpg b/public/assets/content/display_content/image/2.jpg new file mode 100644 index 0000000..cb9cd69 Binary files /dev/null and b/public/assets/content/display_content/image/2.jpg differ diff --git a/public/assets/content/display_content/image/3.jpg b/public/assets/content/display_content/image/3.jpg new file mode 100644 index 0000000..05493f5 Binary files /dev/null and b/public/assets/content/display_content/image/3.jpg differ diff --git a/public/assets/content/display_content/image/4.jpg b/public/assets/content/display_content/image/4.jpg new file mode 100644 index 0000000..c597dfb Binary files /dev/null and b/public/assets/content/display_content/image/4.jpg differ diff --git a/public/assets/content/display_content/image/5.jpg b/public/assets/content/display_content/image/5.jpg new file mode 100644 index 0000000..e1bc228 Binary files /dev/null and b/public/assets/content/display_content/image/5.jpg differ diff --git a/public/assets/content/display_content/video/1.mp4 b/public/assets/content/display_content/video/1.mp4 new file mode 100644 index 0000000..fd73dab Binary files /dev/null and b/public/assets/content/display_content/video/1.mp4 differ diff --git a/public/assets/content/display_content/video/1bak.mp4 b/public/assets/content/display_content/video/1bak.mp4 new file mode 100644 index 0000000..caa57b2 Binary files /dev/null and b/public/assets/content/display_content/video/1bak.mp4 differ diff --git a/public/assets/content/display_content/video/2.mp4 b/public/assets/content/display_content/video/2.mp4 new file mode 100644 index 0000000..57e0acf Binary files /dev/null and b/public/assets/content/display_content/video/2.mp4 differ diff --git a/public/assets/content/display_content/video/3.mp4 b/public/assets/content/display_content/video/3.mp4 new file mode 100644 index 0000000..24b738c Binary files /dev/null and b/public/assets/content/display_content/video/3.mp4 differ diff --git a/public/assets/content/display_content/video/fixed.mp4 b/public/assets/content/display_content/video/fixed.mp4 new file mode 100644 index 0000000..f606e04 Binary files /dev/null and b/public/assets/content/display_content/video/fixed.mp4 differ diff --git a/public/assets/content/display_content/video/new_2.mp4 b/public/assets/content/display_content/video/new_2.mp4 new file mode 100644 index 0000000..731c318 Binary files /dev/null and b/public/assets/content/display_content/video/new_2.mp4 differ diff --git a/public/assets/content/display_content/video/new_3.mp4 b/public/assets/content/display_content/video/new_3.mp4 new file mode 100644 index 0000000..77a80f6 Binary files /dev/null and b/public/assets/content/display_content/video/new_3.mp4 differ diff --git a/public/assets/content/display_content/video/new_4.mp4 b/public/assets/content/display_content/video/new_4.mp4 new file mode 100644 index 0000000..15dad57 Binary files /dev/null and b/public/assets/content/display_content/video/new_4.mp4 differ diff --git a/public/assets/content/display_content/video/new_5.mp4 b/public/assets/content/display_content/video/new_5.mp4 new file mode 100644 index 0000000..5039cec Binary files /dev/null and b/public/assets/content/display_content/video/new_5.mp4 differ diff --git a/public/assets/content/display_content/video/video_2.mp4 b/public/assets/content/display_content/video/video_2.mp4 new file mode 100644 index 0000000..452c39b Binary files /dev/null and b/public/assets/content/display_content/video/video_2.mp4 differ diff --git a/public/assets/content/display_content/video/video_2bak.mp4 b/public/assets/content/display_content/video/video_2bak.mp4 new file mode 100644 index 0000000..7e128bc Binary files /dev/null and b/public/assets/content/display_content/video/video_2bak.mp4 differ diff --git a/public/assets/content/display_content/video/video_3.mp4 b/public/assets/content/display_content/video/video_3.mp4 new file mode 100644 index 0000000..eb835fe Binary files /dev/null and b/public/assets/content/display_content/video/video_3.mp4 differ diff --git a/public/assets/content/display_content/video/video_3bak.mp4 b/public/assets/content/display_content/video/video_3bak.mp4 new file mode 100644 index 0000000..8ff2b75 Binary files /dev/null and b/public/assets/content/display_content/video/video_3bak.mp4 differ diff --git a/public/assets/content/display_content/video/video_4.mp4 b/public/assets/content/display_content/video/video_4.mp4 new file mode 100644 index 0000000..5c35b84 Binary files /dev/null and b/public/assets/content/display_content/video/video_4.mp4 differ diff --git a/public/assets/content/display_content/video/video_5.mp4 b/public/assets/content/display_content/video/video_5.mp4 new file mode 100644 index 0000000..aa38a0a Binary files /dev/null and b/public/assets/content/display_content/video/video_5.mp4 differ diff --git a/routes/api.php b/routes/api.php index fa199c4..367e131 100644 --- a/routes/api.php +++ b/routes/api.php @@ -3,6 +3,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; use App\Http\Controllers\Api\V1\ConfigParameter; +use App\Http\Controllers\Api\V1\DisplayContentController; use App\Http\Controllers\Api\V1\LaporanController; use App\Http\Controllers\Api\V1\MemberinController; use App\Http\Controllers\Api\V1\TransaksiMember; @@ -40,3 +41,7 @@ Route::post('gate', [LaporanController::class, 'gate']); Route::post('daily', [LaporanController::class, 'daily']); }); + +Route::prefix('display')->group(function () { + Route::get('content', [DisplayContentController::class, 'index']); +});