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