41 lines
765 B
PHP
41 lines
765 B
PHP
<?php
|
|
|
|
namespace Modules\PMS\Repositories;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Modules\PMS\Models\Ticket;
|
|
|
|
class TicketRepository implements TicketInterface
|
|
{
|
|
public function findAll()
|
|
{
|
|
return Ticket::paginate(20);
|
|
|
|
}
|
|
|
|
public function getTicketById($TicketId)
|
|
{
|
|
return Ticket::findOrFail($TicketId);
|
|
}
|
|
|
|
public function delete($TicketId)
|
|
{
|
|
Ticket::destroy($TicketId);
|
|
}
|
|
|
|
public function create($TicketDetails)
|
|
{
|
|
return Ticket::create($TicketDetails);
|
|
}
|
|
|
|
public function update($TicketId, array $newDetails)
|
|
{
|
|
return Ticket::whereId($TicketId)->update($newDetails);
|
|
}
|
|
|
|
public function pluck()
|
|
{
|
|
return Ticket::pluck('Ticket_name', 'id');
|
|
}
|
|
|
|
}
|