StocksNew/Modules/PMS/app/Repositories/TicketRepository.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

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');
}
}