36 lines
635 B
PHP
36 lines
635 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('event_id', $eventId)->update($newDetails);
|
||
|
}
|
||
|
|
||
|
}
|