Files
new_raffles/Modules/Admin/app/Repositories/EventRepository.php
2025-07-27 17:40:56 +05:45

36 lines
629 B
PHP

<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Event;
class EventRepository implements EventInterface
{
public function findAll()
{
return Event::get();
}
public function getEventById($EventId)
{
return Event::findOrFail($EventId);
}
public function delete($EventId)
{
Event::destroy($EventId);
}
public function create(array $EventDetails)
{
return Event::create($EventDetails);
}
public function update($EventId, array $newDetails)
{
return Event::where('id', $EventId)->update($newDetails);
}
}