mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-30 20:16:46 -04:00
35 lines
655 B
PHP
35 lines
655 B
PHP
<?php
|
|
namespace Modules\ContactRequest\Repositories;
|
|
|
|
use App\Models\Contact;
|
|
|
|
class ContactRepository{
|
|
|
|
protected $contact;
|
|
|
|
public function __construct(Contact $contact){
|
|
$this->contact = $contact;
|
|
}
|
|
|
|
public function getAll(){
|
|
return $this->contact::all();
|
|
}
|
|
|
|
public function getById($id){
|
|
return $this->contact::findOrFail($id);
|
|
}
|
|
|
|
|
|
|
|
public function statusUpdate($data, $id){
|
|
return $this->contact::where('id',$id)->update([
|
|
'status' => $data['status']
|
|
]);
|
|
}
|
|
|
|
public function deleteById($id){
|
|
|
|
return $this->contact->findOrFail($id)->delete();
|
|
}
|
|
}
|