⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.170
Server IP:
15.204.235.159
Server:
Linux srv.techlup.co.ke 4.18.0-553.5.1.el8_10.x86_64 #1 SMP Wed Jun 5 09:12:13 EDT 2024 x86_64
Server Software:
Apache
PHP Version:
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
tech
/
www
/
script
/
am-content
/
Plugins
/
View File Name :
PluginServiceProvider.php
<?php namespace Amcoders\Plugin; use Illuminate\Foundation\AliasLoader; use Illuminate\Support\ServiceProvider; /** * */ class PluginServiceProvider extends ServiceProvider { public function register() { $this->app->booting(function() { $loader = AliasLoader::getInstance(); $loader->alias('Plugin', 'Plugin::class'); $files = file_get_contents( base_path().'/am-content/Plugins/Helper.json'); $helpers = json_decode($files, true); if (is_array($helpers) || is_object($helpers)) { foreach ($helpers as $key => $value) { $loader->alias($value['name'], $value['class']); } } }); } public function boot() { $file = file_get_contents( base_path().'/am-content/Plugins/plugin.json'); $plugins = json_decode($file, true); foreach ($plugins as $plugin) { if ($plugin['status'] == 'active') { $this->loadRoutesFrom(__DIR__.'/'.$plugin['Text Domain'].'/routes/web.php'); $this->loadMigrationsFrom(__DIR__.'/'.$plugin['Text Domain'].'/migrations'); $this->loadViewsFrom(__DIR__.'/'.$plugin['Text Domain'].'/views', 'plugin'); } } } }