mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-15 02:07:56 -04:00
40 lines
1012 B
PHP
40 lines
1012 B
PHP
<?php
|
|
|
|
namespace Modules\GeneralSetting\Repositories;
|
|
|
|
use Modules\GeneralSetting\Entities\NotificationSetting;
|
|
use Modules\OrderManage\Entities\CustomerNotification;
|
|
|
|
class NotificationSettingRepository
|
|
{
|
|
public function all()
|
|
{
|
|
return NotificationSetting::all();
|
|
}
|
|
|
|
|
|
public function single($id)
|
|
{
|
|
return NotificationSetting::findOrFail($id);
|
|
}
|
|
|
|
|
|
public function update($request,$id)
|
|
{
|
|
$notificationSetting = NotificationSetting::findOrFail($id);
|
|
$notificationSetting->message = $request->message;
|
|
$notificationSetting->admin_msg = $request->admin_msg;
|
|
$notificationtype="";
|
|
foreach($request->type as $type){
|
|
$notificationtype .= $type.",";
|
|
}
|
|
$notificationSetting->type = $notificationtype;
|
|
$notificationSetting->save();
|
|
}
|
|
|
|
public function userNotifications($user_id)
|
|
{
|
|
return CustomerNotification::with('order')->where('customer_id',$user_id)->paginate(10);
|
|
}
|
|
}
|