StocksNew/Modules/Training/app/Repositories/TrainingListRepository.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

35 lines
766 B
PHP

<?php
namespace Modules\Training\Repositories;
use Modules\Training\Models\TrainingList;
class TrainingListRepository implements TrainingListInterface
{
public function findAll()
{
return TrainingList::get();
}
public function getTrainingListById($trainingListId)
{
return TrainingList::findOrFail($trainingListId);
}
public function delete($trainingListId)
{
TrainingList::destroy($trainingListId);
}
public function create(array $trainingListDetails)
{
return TrainingList::create($trainingListDetails);
}
public function update($trainingListId, array $newDetails)
{
return TrainingList::where('trainingList_id', $trainingListId)->update($newDetails);
}
}