⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
dnc
/
@core
/
vendor
/
tzsk
/
payu
/
src
/
View File Name :
PayuServiceProvider.php
<?php namespace Tzsk\Payu; use Illuminate\Support\Facades\Blade; use Illuminate\Support\ServiceProvider; use Illuminate\View\Compilers\BladeCompiler; use Tzsk\Payu\Commands\PublishComponents; use Tzsk\Payu\Commands\VerifyPendingTransactions; use Tzsk\Payu\Components\Form; class PayuServiceProvider extends ServiceProvider { public function boot(): void { if ($this->app->runningInConsole()) { $this->publishes([ __DIR__ . '/../config/payu.php' => config_path('payu.php'), ], 'payu-config'); $this->publishes([ __DIR__ . '/../resources/views' => base_path('resources/views/vendor/payu'), ], 'payu-template'); $migrationFileName = 'create_payu_transactions_table.php'; $source = __DIR__ . "/../database/migrations/{$migrationFileName}"; if (! $this->migrationFileExists($migrationFileName)) { $destination = database_path('migrations/' . date('Y_m_d_His', time()) . '_' . $migrationFileName); $this->publishes([$source => $destination], 'payu-migration'); } $this->commands([ PublishComponents::class, VerifyPendingTransactions::class, ]); } $this->loadViewsFrom(__DIR__ . '/../resources/views', 'payu'); $this->loadRoutesFrom(__DIR__ . '/../routes/payu.php'); $this->callAfterResolving(BladeCompiler::class, function () { Blade::component(Form::class, 'payu-form'); }); $this->app->bind('payu', function () { return new Payu(); }); } public function register(): void { $this->mergeConfigFrom(__DIR__ . '/../config/payu.php', 'payu'); } public static function migrationFileExists(string $migrationFileName): bool { $len = strlen($migrationFileName); foreach (glob(database_path("migrations/*.php")) as $filename) { if ((substr($filename, -$len) === $migrationFileName)) { return true; } } return false; } }