mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-09-29 21:13:05 -04:00
52 lines
1.8 KiB
PHP
52 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace Modules\StaffPortal\Http\Controllers;
|
|
|
|
use Illuminate\Contracts\Support\Renderable;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Routing\Controller;
|
|
use Brian2694\Toastr\Facades\Toastr;
|
|
use Modules\UserActivityLog\Traits\LogActivity;
|
|
use App\Models\User;
|
|
|
|
class CustomerController extends Controller
|
|
{
|
|
|
|
public function saveSignupData(Request $data, $id){
|
|
|
|
try {
|
|
|
|
$user = User::find($id);
|
|
|
|
if($user->job_category_id == 17) {
|
|
|
|
$data['asin'] = explode(',', $data['asin']);
|
|
$user->job_category_data_updated = json_encode($data->only('asin', 'video_creator', 'shipping_info', 'tracking_info', 'product_received', 'video_published'));
|
|
|
|
} else if($user->job_category_id == 25) {
|
|
|
|
$data['asin'] = explode(',', $data['asin']);
|
|
$data['product_names'] = preg_split ('/\r\n|\r|\n/', $data['product_names']);
|
|
|
|
if($file = $data->file('brand_logo')){
|
|
$brand_logo = ImageStore::saveImage($file);
|
|
$data['sponsored_logo'] = $brand_logo;
|
|
}
|
|
|
|
$user->job_category_data_updated = json_encode($data->only('sponsored_live_shows','sponsored_asin','sponsored_logo','featured_total','asin','product_names','featured_item','pov_video_asin', 'pov_video_link', 'date_scheduled', 'livestream_completed'));
|
|
}
|
|
|
|
$user->save();
|
|
|
|
Toastr::success(__('common.updated_successfully'), __('common.success'));
|
|
LogActivity::successLog('Customer Signup Data Updated Successfully.');
|
|
return redirect()->back();
|
|
} catch (Exception $e){
|
|
|
|
LogActivity::errorLog($e->getMessage());
|
|
Toastr::error(__('common.error_message'), __('common.error'));
|
|
return back();
|
|
}
|
|
}
|
|
}
|