first commit
This commit is contained in:
40
Modules/PMS/app/Repositories/TicketRepository.php
Normal file
40
Modules/PMS/app/Repositories/TicketRepository.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user