taxation
This commit is contained in:
58
Modules/Taxation/app/Repositories/EmployeeRepository.php
Normal file
58
Modules/Taxation/app/Repositories/EmployeeRepository.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Employee\Repositories;
|
||||
|
||||
use Modules\Employee\Models\Employee;
|
||||
|
||||
class EmployeeRepository implements EmployeeInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Employee::paginate(20);
|
||||
}
|
||||
|
||||
public function getEmployeeById($employeeId)
|
||||
{
|
||||
return Employee::findOrFail($employeeId);
|
||||
}
|
||||
|
||||
public function getEmployeeByEmail($email)
|
||||
{
|
||||
return Employee::where('email', $email)->first();
|
||||
}
|
||||
|
||||
public function delete($employeeId)
|
||||
{
|
||||
Employee::destroy($employeeId);
|
||||
}
|
||||
|
||||
public function create($employeeDetails)
|
||||
{
|
||||
return Employee::create($employeeDetails);
|
||||
}
|
||||
|
||||
public function update($employeeId, array $newDetails)
|
||||
{
|
||||
return Employee::whereId($employeeId)->update($newDetails);
|
||||
}
|
||||
|
||||
public function pluck()
|
||||
{
|
||||
return Employee::pluck('first_name', 'id');
|
||||
}
|
||||
|
||||
// public function uploadImage($file)
|
||||
// {
|
||||
// if ($req->file()) {
|
||||
// $fileName = time() . '_' . $req->file->getClientOriginalName();
|
||||
// $filePath = $req->file('file')->storeAs('uploads', $fileName, 'public');
|
||||
// $fileModel->name = time() . '_' . $req->file->getClientOriginalName();
|
||||
// $fileModel->file_path = '/storage/' . $filePath;
|
||||
// $fileModel->save();
|
||||
// return back()
|
||||
// ->with('success', 'File has been uploaded.')
|
||||
// ->with('file', $fileName);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
Reference in New Issue
Block a user