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

40 lines
759 B
PHP

<?php
namespace Modules\Training\Repositories;
use Modules\Training\Models\Trainer;
class TrainerRepository implements TrainerInterface
{
public function findAll()
{
return Trainer::get();
}
public function getTrainerById($trainerId)
{
return Trainer::findOrFail($trainerId);
}
public function delete($trainerId)
{
Trainer::destroy($trainerId);
}
public function create(array $trainerDetails)
{
return Trainer::create($trainerDetails);
}
public function update($trainerId, array $newDetails)
{
return Trainer::where('id', $trainerId)->update($newDetails);
}
public function pluck()
{
return Trainer::pluck('first_name','id');
}
}