36 lines
629 B
PHP
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);
|
|
}
|
|
|
|
}
|