mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-28 23:17:58 -04:00
37 lines
742 B
PHP
37 lines
742 B
PHP
<?php
|
|
namespace Modules\OrderManage\Repositories;
|
|
|
|
use Modules\OrderManage\Entities\CancelReason;
|
|
use Carbon\Carbon;
|
|
|
|
class CancelReasonRepository
|
|
{
|
|
public function getAll()
|
|
{
|
|
return CancelReason::all();
|
|
}
|
|
|
|
public function save($data)
|
|
{
|
|
$cancelReason = new CancelReason();
|
|
$cancelReason->fill($data)->save();
|
|
}
|
|
|
|
public function update($data, $id)
|
|
{
|
|
CancelReason::findOrFail($id)->update([
|
|
'name' => $data['name'],
|
|
'description' => $data['description']
|
|
]);
|
|
}
|
|
|
|
public function delete($id)
|
|
{
|
|
return CancelReason::findOrFail($id)->delete();
|
|
}
|
|
|
|
public function getById($id){
|
|
return CancelReason::find($id);
|
|
}
|
|
}
|