42 lines
893 B
PHP
42 lines
893 B
PHP
<?php
|
|
|
|
namespace App\Repositories;
|
|
use App\Models\TrRegistrasi;
|
|
use App\Interfaces\TrRegistrasiInterface;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
class TrRegistrasiRepository implements TrRegistrasiInterface
|
|
{
|
|
private $trRegistrasi;
|
|
|
|
public function __construct(TrRegistrasi $trRegistrasi)
|
|
{
|
|
$this->trRegistrasi = $trRegistrasi;
|
|
}
|
|
|
|
public function getAll()
|
|
{
|
|
return $this->trRegistrasi->all();
|
|
}
|
|
|
|
public function getById($id)
|
|
{
|
|
return $this->trRegistrasi->find($id);
|
|
}
|
|
|
|
public function store($data)
|
|
{
|
|
$data['tanggal_registrasi'] = now();
|
|
return $this->trRegistrasi->create($data);
|
|
}
|
|
|
|
public function update($id, $data)
|
|
{
|
|
return $this->trRegistrasi->find($id)->update($data);
|
|
}
|
|
|
|
public function delete($id)
|
|
{
|
|
return $this->trRegistrasi->find($id)->delete();
|
|
}
|
|
} |