blessing-skin-server/app/Services/Webpack.php
2019-09-07 10:18:24 +08:00

27 lines
524 B
PHP

<?php
declare(strict_types=1);
namespace App\Services;
use Illuminate\Support\Arr;
use Illuminate\Filesystem\Filesystem;
class Webpack
{
protected $manifest = [];
public function __construct(Filesystem $filesystem)
{
$path = public_path('app/manifest.json');
if ($filesystem->exists($path)) {
$this->manifest = json_decode($filesystem->get($path), true);
}
}
public function __get(string $path)
{
return Arr::get($this->manifest, $path, '');
}
}