StocksNew/Modules/PMS/app/Repositories/TicketRepository.php

41 lines
765 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?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');
}
}