mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-31 14:16:57 -04:00
33 lines
906 B
PHP
33 lines
906 B
PHP
<?php
|
|
|
|
namespace Modules\Appearance\Repositories;
|
|
|
|
use File;
|
|
class CustomAssetRepository
|
|
{
|
|
public function getFileContent(){
|
|
$data = [];
|
|
if (file_exists(base_path('public/css/custom.css'))) {
|
|
$data['custom_css'] = file_get_contents(base_path('public/css/custom.css'));
|
|
}
|
|
if (file_exists(base_path('public/js/custom.js'))) {
|
|
$data['custom_js'] = file_get_contents(base_path('public/js/custom.js'));
|
|
}
|
|
return $data;
|
|
}
|
|
|
|
public function updateCustomFile($data){
|
|
if($data['custom_css'] == null){
|
|
$data['custom_css'] = '';
|
|
}
|
|
File::put(base_path('public/css/custom.css'), $data['custom_css']);
|
|
|
|
if($data['custom_js'] == null){
|
|
$data['custom_js'] = '';
|
|
}
|
|
File::put(base_path('public/js/custom.js'), $data['custom_js']);
|
|
|
|
return true;
|
|
}
|
|
}
|