first commit
This commit is contained in:
0
Modules/Training/app/Http/Controllers/.gitkeep
Normal file
0
Modules/Training/app/Http/Controllers/.gitkeep
Normal file
100
Modules/Training/app/Http/Controllers/TrainerController.php
Normal file
100
Modules/Training/app/Http/Controllers/TrainerController.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Training\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Employee\Repositories\EmployeeRepository;
|
||||
use Modules\Training\Repositories\TrainerRepository;
|
||||
|
||||
class TrainerController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
private $employeeRepository;
|
||||
private $trainerRepository;
|
||||
|
||||
|
||||
|
||||
public function __construct(TrainerRepository $trainerRepository, EmployeeRepository $employeeRepository ){
|
||||
$this->employeeRepository = $employeeRepository;
|
||||
$this->trainerRepository = $trainerRepository;
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = 'Trainer Lists';
|
||||
$data['trainerLists'] = $this->trainerRepository->findAll();
|
||||
|
||||
return view ('training::trainer.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'Create Trainer';
|
||||
$data['editable'] = false;
|
||||
|
||||
return view('training::trainer.create', $data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$this->trainerRepository->create($request->all());
|
||||
toastr()->success('Trainer Created Successfully');
|
||||
return redirect()->route('trainer.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$data['title'] = 'Training Details';
|
||||
$data['item'] = $this->trainerRepository->getTrainerById($id);
|
||||
return view('training::trainer.show', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = 'Edit Leave';
|
||||
$data['editable'] = true;
|
||||
$data['trainer'] = $this->trainerRepository->getTrainerById($id);
|
||||
return view('training::trainer.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$inputData = $request->all();
|
||||
$this->trainerRepository->update($id, $inputData);
|
||||
toastr()->success('Trainer Updated Succesfully');
|
||||
|
||||
return redirect()->route('trainer.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->trainerRepository->delete($id);
|
||||
toastr()->success('Trainer Deleted Succesfully');
|
||||
}
|
||||
}
|
114
Modules/Training/app/Http/Controllers/TrainingListController.php
Normal file
114
Modules/Training/app/Http/Controllers/TrainingListController.php
Normal file
@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Training\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Admin\Repositories\DepartmentRepository;
|
||||
use Modules\Employee\Repositories\EmployeeRepository;
|
||||
use Modules\Training\Repositories\TrainerRepository;
|
||||
use Modules\Training\Repositories\TrainingListRepository;
|
||||
|
||||
|
||||
|
||||
class TrainingListController extends Controller
|
||||
{
|
||||
private $trainingListRepository;
|
||||
private $employeeRepository;
|
||||
private $trainerRepository;
|
||||
private $departmentRepository;
|
||||
|
||||
|
||||
public function __construct(TrainingListRepository $trainingListRepository,
|
||||
EmployeeRepository $employeeRepository,
|
||||
TrainerRepository $trainerRepository,
|
||||
DepartmentRepository $departmentRepository )
|
||||
{
|
||||
$this->trainingListRepository = $trainingListRepository;
|
||||
$this->employeeRepository = $employeeRepository;
|
||||
$this->trainerRepository = $trainerRepository;
|
||||
$this->departmentRepository = $departmentRepository;
|
||||
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = 'Training Lists';
|
||||
$data['trainingLists'] = $this->trainingListRepository->findAll();
|
||||
|
||||
return view('training::training-list.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'Create Training List';
|
||||
$data['editable'] = false;
|
||||
$data['employee'] = $this->employeeRepository->pluck();
|
||||
$data['trainer'] = $this->trainerRepository->pluck();
|
||||
$data['department'] = $this->departmentRepository->pluck();
|
||||
|
||||
|
||||
return view('training::training-list.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$this->trainingListRepository->create($request->all());
|
||||
toastr()->success('Training List Created Successfully');
|
||||
|
||||
return redirect()->route('trainingList.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$data['title'] = 'Training Details';
|
||||
$data['item'] = $this->trainingListRepository->getTrainingListById($id);
|
||||
|
||||
return view('training::training-list.show', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['editable'] = true;
|
||||
$data['trainingList'] = $this->trainingListRepository->getTrainingListById($id);
|
||||
|
||||
return view('training::training-list.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$inputData = $request->all();
|
||||
$this->trainingListRepository->update($id, $inputData);
|
||||
toastr()->success('Training List Updated Succesfully');
|
||||
|
||||
return redirect()->route('trading-list.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->trainingListRepository->delete($id);
|
||||
toastr()->success('Training List Deleted Succesfully');
|
||||
}
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Training\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Training\Repositories\TrainingTypeRepository;
|
||||
|
||||
class TrainingTypeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
private $trainingTypeRepository;
|
||||
|
||||
public function __construct(TrainingTypeRepository $trainingTypeRepository ){
|
||||
$this->trainingTypeRepository = $trainingTypeRepository;
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = 'Training Type Lists';
|
||||
$data['trainingTypes'] = $this->trainingTypeRepository->findAll();
|
||||
|
||||
return view('training::training-type.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'Create Training Type';
|
||||
$data['editable'] = false;
|
||||
|
||||
return view('training::training-type.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$this->trainingTypeRepository->create($request->all());
|
||||
toastr()->success('Training Type Created Successfully');
|
||||
return redirect()->route('trainingType.index');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$data['title'] = 'Training Type Details';
|
||||
$data['item'] = $this->trainingTypeRepository->getTrainingTypeById($id);
|
||||
return view('training::training-type.show', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = 'Edit TraingType';
|
||||
$data['editable'] = true;
|
||||
$data['trainer'] = $this->trainingTypeRepository->getTrainingTypeById($id);
|
||||
return view('training::training-type.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$inputData = $request->all();
|
||||
$this->trainingTypeRepository->update($id, $inputData);
|
||||
toastr()->success('Training Type Updated Succesfully');
|
||||
|
||||
return redirect()->route('training-type.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->trainingTypeRepository->delete($id);
|
||||
toastr()->success('Training Type Deleted Succesfully');
|
||||
}
|
||||
}
|
0
Modules/Training/app/Http/Requests/.gitkeep
Normal file
0
Modules/Training/app/Http/Requests/.gitkeep
Normal file
Reference in New Issue
Block a user