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
0
Modules/Training/app/Models/.gitkeep
Normal file
0
Modules/Training/app/Models/.gitkeep
Normal file
36
Modules/Training/app/Models/Trainer.php
Normal file
36
Modules/Training/app/Models/Trainer.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Training\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Training\Database\factories\TrainerFactory;
|
||||
|
||||
class Trainer extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_trainers';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['first_name',
|
||||
'middle_name',
|
||||
'last_name',
|
||||
'phone',
|
||||
'email',
|
||||
'address',
|
||||
'shift',
|
||||
'salary',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'status',
|
||||
'remarks',
|
||||
];
|
||||
|
||||
protected static function newFactory(): TrainerFactory
|
||||
{
|
||||
//return TrainerFactory::new();
|
||||
}
|
||||
}
|
53
Modules/Training/app/Models/TrainingList.php
Normal file
53
Modules/Training/app/Models/TrainingList.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Training\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Admin\Models\Department;
|
||||
use Modules\Employee\Models\Employee;
|
||||
use Modules\Training\Database\factories\TrainingListFactory;
|
||||
|
||||
class TrainingList extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'tbl_training_lists';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'training_by',
|
||||
'trainer_id',
|
||||
'assigned_id',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'department_id',
|
||||
'shift',
|
||||
'status',
|
||||
'remarks',
|
||||
];
|
||||
|
||||
protected static function newFactory(): TrainingListFactory
|
||||
{
|
||||
//return TrainingListFactory::new();
|
||||
}
|
||||
|
||||
public function employee()
|
||||
{
|
||||
return $this->belongsTo(Employee::class, 'assigned_id');
|
||||
}
|
||||
|
||||
public function trainer()
|
||||
{
|
||||
return $this->belongsTo(Trainer::class,'trainer_id');
|
||||
}
|
||||
|
||||
public function department()
|
||||
{
|
||||
return $this->belongsTo(Department::class,'department_id');
|
||||
}
|
||||
|
||||
|
||||
}
|
26
Modules/Training/app/Models/TrainingType.php
Normal file
26
Modules/Training/app/Models/TrainingType.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Training\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Training\Database\factories\TrainingTypeFactory;
|
||||
|
||||
class TrainingType extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'tbl_training_types';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'training_type',
|
||||
'status',
|
||||
'remarks',
|
||||
];
|
||||
|
||||
protected static function newFactory(): TrainingTypeFactory
|
||||
{
|
||||
//return TrainingTypeFactory::new();
|
||||
}
|
||||
}
|
0
Modules/Training/app/Observers/.gitkeep
Normal file
0
Modules/Training/app/Observers/.gitkeep
Normal file
0
Modules/Training/app/Providers/.gitkeep
Normal file
0
Modules/Training/app/Providers/.gitkeep
Normal file
49
Modules/Training/app/Providers/RouteServiceProvider.php
Normal file
49
Modules/Training/app/Providers/RouteServiceProvider.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Training\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Called before routes are registered.
|
||||
*
|
||||
* Register any model bindings or pattern based filters.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*/
|
||||
public function map(): void
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
|
||||
$this->mapWebRoutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*/
|
||||
protected function mapWebRoutes(): void
|
||||
{
|
||||
Route::middleware('web')->group(module_path('Training', '/routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*/
|
||||
protected function mapApiRoutes(): void
|
||||
{
|
||||
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Training', '/routes/api.php'));
|
||||
}
|
||||
}
|
114
Modules/Training/app/Providers/TrainingServiceProvider.php
Normal file
114
Modules/Training/app/Providers/TrainingServiceProvider.php
Normal file
@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Training\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class TrainingServiceProvider extends ServiceProvider
|
||||
{
|
||||
protected string $moduleName = 'Training';
|
||||
|
||||
protected string $moduleNameLower = 'training';
|
||||
|
||||
/**
|
||||
* Boot the application events.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
$this->registerCommands();
|
||||
$this->registerCommandSchedules();
|
||||
$this->registerTranslations();
|
||||
$this->registerConfig();
|
||||
$this->registerViews();
|
||||
$this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->register(RouteServiceProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register commands in the format of Command::class
|
||||
*/
|
||||
protected function registerCommands(): void
|
||||
{
|
||||
// $this->commands([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register command Schedules.
|
||||
*/
|
||||
protected function registerCommandSchedules(): void
|
||||
{
|
||||
// $this->app->booted(function () {
|
||||
// $schedule = $this->app->make(Schedule::class);
|
||||
// $schedule->command('inspire')->hourly();
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
* Register translations.
|
||||
*/
|
||||
public function registerTranslations(): void
|
||||
{
|
||||
$langPath = resource_path('lang/modules/'.$this->moduleNameLower);
|
||||
|
||||
if (is_dir($langPath)) {
|
||||
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom($langPath);
|
||||
} else {
|
||||
$this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register config.
|
||||
*/
|
||||
protected function registerConfig(): void
|
||||
{
|
||||
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config');
|
||||
$this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register views.
|
||||
*/
|
||||
public function registerViews(): void
|
||||
{
|
||||
$viewPath = resource_path('views/modules/'.$this->moduleNameLower);
|
||||
$sourcePath = module_path($this->moduleName, 'resources/views');
|
||||
|
||||
$this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-views']);
|
||||
|
||||
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
|
||||
|
||||
$componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.ltrim(config('modules.paths.generator.component-class.path'), config('modules.paths.app_folder','')));
|
||||
Blade::componentNamespace($componentNamespace, $this->moduleNameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*/
|
||||
public function provides(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function getPublishableViewPaths(): array
|
||||
{
|
||||
$paths = [];
|
||||
foreach (config('view.paths') as $path) {
|
||||
if (is_dir($path.'/modules/'.$this->moduleNameLower)) {
|
||||
$paths[] = $path.'/modules/'.$this->moduleNameLower;
|
||||
}
|
||||
}
|
||||
|
||||
return $paths;
|
||||
}
|
||||
}
|
0
Modules/Training/app/Repositories/.gitkeep
Normal file
0
Modules/Training/app/Repositories/.gitkeep
Normal file
12
Modules/Training/app/Repositories/TrainerInterface.php
Normal file
12
Modules/Training/app/Repositories/TrainerInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Training\Repositories;
|
||||
|
||||
interface TrainerInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getTrainerById($trainerId);
|
||||
public function delete($trainerId);
|
||||
public function create(array $trainerDetails);
|
||||
public function update($trainerId, array $newDetails);
|
||||
}
|
39
Modules/Training/app/Repositories/TrainerRepository.php
Normal file
39
Modules/Training/app/Repositories/TrainerRepository.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
12
Modules/Training/app/Repositories/TrainingListInterface.php
Normal file
12
Modules/Training/app/Repositories/TrainingListInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Training\Repositories;
|
||||
|
||||
interface TrainingListInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getTrainingListById($trainingListId);
|
||||
public function delete($trainingListId);
|
||||
public function create(array $trainingListDetails);
|
||||
public function update($trainingListId, array $newDetails);
|
||||
}
|
34
Modules/Training/app/Repositories/TrainingListRepository.php
Normal file
34
Modules/Training/app/Repositories/TrainingListRepository.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Training/app/Repositories/TrainingTypeInterface.php
Normal file
12
Modules/Training/app/Repositories/TrainingTypeInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Training\Repositories;
|
||||
|
||||
interface TrainingTypeInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getTrainingTypeById($trainingTypeId);
|
||||
public function delete($trainingTypeId);
|
||||
public function create(array $trainingTypeDetails);
|
||||
public function update($trainingTypeId, array $newDetails);
|
||||
}
|
34
Modules/Training/app/Repositories/TrainingTypeRepository.php
Normal file
34
Modules/Training/app/Repositories/TrainingTypeRepository.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Training\Repositories;
|
||||
|
||||
use Modules\Training\Models\TrainingType;
|
||||
|
||||
class TrainingTypeRepository implements TrainingTypeInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return TrainingType::get();
|
||||
}
|
||||
|
||||
public function getTrainingTypeById($trainingTypeId)
|
||||
{
|
||||
return TrainingType::findOrFail($trainingTypeId);
|
||||
}
|
||||
|
||||
public function delete($trainingTypeId)
|
||||
{
|
||||
TrainingType::destroy($trainingTypeId);
|
||||
}
|
||||
|
||||
public function create(array $trainingTypeDetails)
|
||||
{
|
||||
return TrainingType::create($trainingTypeDetails);
|
||||
}
|
||||
|
||||
public function update($trainingTypeId, array $newDetails)
|
||||
{
|
||||
return TrainingType::where('TrainingType_id', $trainingTypeId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
30
Modules/Training/composer.json
Normal file
30
Modules/Training/composer.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "nwidart/training",
|
||||
"description": "",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Widart",
|
||||
"email": "n.widart@gmail.com"
|
||||
}
|
||||
],
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [],
|
||||
"aliases": {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Modules\\Training\\": "app/",
|
||||
"Modules\\Training\\Database\\Factories\\": "database/factories/",
|
||||
"Modules\\Training\\Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Modules\\Training\\Tests\\": "tests/"
|
||||
}
|
||||
}
|
||||
}
|
0
Modules/Training/config/.gitkeep
Normal file
0
Modules/Training/config/.gitkeep
Normal file
5
Modules/Training/config/config.php
Normal file
5
Modules/Training/config/config.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'name' => 'Training',
|
||||
];
|
0
Modules/Training/database/factories/.gitkeep
Normal file
0
Modules/Training/database/factories/.gitkeep
Normal file
0
Modules/Training/database/migrations/.gitkeep
Normal file
0
Modules/Training/database/migrations/.gitkeep
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('tbl_training_types', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('training_type')->nullable();
|
||||
$table->string('status')->nullable()->default(11);
|
||||
$table->string('remarks')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tbl_training_types');
|
||||
}
|
||||
};
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('tbl_trainers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('first_name')->nullable();
|
||||
$table->string('middle_name')->nullable();
|
||||
$table->string('last_name')->nullable();
|
||||
$table->string('phone')->nullable();
|
||||
$table->string('email')->nullable();
|
||||
$table->text('address')->nullable();
|
||||
$table->string('shift')->nullable();
|
||||
$table->string('salary')->nullable();
|
||||
$table->date('start_date')->nullable();
|
||||
$table->date('end_date')->nullable();
|
||||
$table->string('status')->nullable()->default(11);
|
||||
$table->string('remarks')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tbl_trainers');
|
||||
}
|
||||
};
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('tbl_training_lists', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('training_by')->nullable();
|
||||
$table->string('trainer_id')->nullable();
|
||||
$table->string('assigned_id')->nullable();
|
||||
$table->date('start_date')->nullable();
|
||||
$table->date('end_date')->nullable();
|
||||
$table->string('department_id')->nullable();
|
||||
$table->string('shift')->nullable();
|
||||
$table->string('status')->nullable()->default(11);
|
||||
$table->string('remarks')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tbl_training_lists');
|
||||
}
|
||||
};
|
0
Modules/Training/database/seeders/.gitkeep
Normal file
0
Modules/Training/database/seeders/.gitkeep
Normal file
16
Modules/Training/database/seeders/TrainingDatabaseSeeder.php
Normal file
16
Modules/Training/database/seeders/TrainingDatabaseSeeder.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Training\database\seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class TrainingDatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// $this->call([]);
|
||||
}
|
||||
}
|
11
Modules/Training/module.json
Normal file
11
Modules/Training/module.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "Training",
|
||||
"alias": "training",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"priority": 0,
|
||||
"providers": [
|
||||
"Modules\\Training\\Providers\\TrainingServiceProvider"
|
||||
],
|
||||
"files": []
|
||||
}
|
15
Modules/Training/package.json
Normal file
15
Modules/Training/package.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^1.1.2",
|
||||
"laravel-vite-plugin": "^0.7.5",
|
||||
"sass": "^1.69.5",
|
||||
"postcss": "^8.3.7",
|
||||
"vite": "^4.0.0"
|
||||
}
|
||||
}
|
0
Modules/Training/resources/assets/.gitkeep
Normal file
0
Modules/Training/resources/assets/.gitkeep
Normal file
0
Modules/Training/resources/assets/js/app.js
Normal file
0
Modules/Training/resources/assets/js/app.js
Normal file
0
Modules/Training/resources/assets/sass/app.scss
Normal file
0
Modules/Training/resources/assets/sass/app.scss
Normal file
0
Modules/Training/resources/views/.gitkeep
Normal file
0
Modules/Training/resources/views/.gitkeep
Normal file
29
Modules/Training/resources/views/layouts/master.blade.php
Normal file
29
Modules/Training/resources/views/layouts/master.blade.php
Normal file
@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
||||
<title>Training Module - {{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<meta name="description" content="{{ $description ?? '' }}">
|
||||
<meta name="keywords" content="{{ $keywords ?? '' }}">
|
||||
<meta name="author" content="{{ $author ?? '' }}">
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
||||
|
||||
{{-- Vite CSS --}}
|
||||
{{-- {{ module_vite('build-training', 'resources/assets/sass/app.scss') }} --}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@yield('content')
|
||||
|
||||
{{-- Vite JS --}}
|
||||
{{-- {{ module_vite('build-training', 'resources/assets/js/app.js') }} --}}
|
||||
</body>
|
23
Modules/Training/resources/views/trainer/create.blade.php
Normal file
23
Modules/Training/resources/views/trainer/create.blade.php
Normal file
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
<!-- end page title -->
|
||||
|
||||
{{ html()->form('POST')->route('trainer.store')->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
|
||||
|
||||
@include('training::trainer.partials.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
23
Modules/Training/resources/views/trainer/edit.blade.php
Normal file
23
Modules/Training/resources/views/trainer/edit.blade.php
Normal file
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
<!-- end page title -->
|
||||
|
||||
{{ html()->modelForm($trainer, 'PUT')->route('trainer.update', $trainer->id)->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
|
||||
|
||||
@include('training::trainer.partials.action')
|
||||
|
||||
{{ html()->closeModelForm() }}
|
||||
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
91
Modules/Training/resources/views/trainer/index.blade.php
Normal file
91
Modules/Training/resources/views/trainer/index.blade.php
Normal file
@ -0,0 +1,91 @@
|
||||
@extends('layouts.app')
|
||||
@use('Carbon\Carbon')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Trainer'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row g-2">
|
||||
<div class="col-sm-4">
|
||||
<div class="search-box">
|
||||
<input type="text" class="form-control" id="searchMemberList" placeholder="Search for name...">
|
||||
<i class="ri-search-line search-icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
<!--end col-->
|
||||
<div class="col-sm-auto ms-auto">
|
||||
<div class="list-grid-nav hstack gap-1">
|
||||
|
||||
<a class="btn btn-success" href="{{ route('trainer.create') }}"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Trainer</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!--end col-->
|
||||
</div>
|
||||
<!--end row-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">S.N</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Full Name</span></th>
|
||||
<th class="tb-col"><span class="overline-title"> Phone</span></th>
|
||||
<th class="tb-col"><span class="overline-title"> Email</span></th>
|
||||
<th class="tb-col"><span class="overline-title"> Shift</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Start Date</span></th>
|
||||
<th class="tb-col"><span class="overline-title">End Date</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($trainerLists as $index => $item)
|
||||
<tr>
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $item->first_name }} {{ $item->last_name }} </td>
|
||||
<td class="tb-col">{{ $item->phone }}</td>
|
||||
<td class="tb-col">{{ $item->email }}</td>
|
||||
<td class="tb-col">{{ $item->shift }}</td>
|
||||
<td class="tb-col">{{ Carbon::parse($item->start_date)->format('h:i A') }}</td>
|
||||
<td class="tb-col">{{ Carbon::parse($item->end_date)->format('h:i A') }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
<a href="javascript:void(0);" class="link-info fs-15 view-item-btn"
|
||||
data-bs-toggle="modal" data-bs-target="#viewModal">
|
||||
<i class="ri-eye-line"></i>
|
||||
</a>
|
||||
<a href="{{ route('trainer.edit', $item->id) }}"
|
||||
class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
|
||||
|
||||
<a href="javascript:void(0);"
|
||||
data-link="{{ route('trainer.destroy', $item->id) }}"
|
||||
data-id="{{ $item->trainer_id }}"
|
||||
class="link-danger fs-15 remove-item-btn"><i
|
||||
class="ri-delete-bin-line"></i></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
|
||||
@endpush
|
@ -0,0 +1,93 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
{{-- <div class="card-header card-primary">
|
||||
<h4 class="card-title mb-0">Personal Details</h4>
|
||||
</div> --}}
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row gy-2">
|
||||
<p class="text-primary">Trainer Details</p>
|
||||
<hr>
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('First name')->class('form-label') }}
|
||||
{{ html()->text('first_name')->class('form-control')->placeholder('Enter First Name')->required() }}
|
||||
{{ html()->div('Please enter first name')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Middle name')->class('form-label') }}
|
||||
{{ html()->text('middle_name')->class('form-control')->placeholder('Enter Middle Name') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Last name')->class('form-label') }}
|
||||
{{ html()->text('last_name')->class('form-control')->placeholder('Enter Last Name')->required() }}
|
||||
{{ html()->div('Please enter last name')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Phone Number')->class('form-label') }}
|
||||
{{ html()->text('phone')->class('form-control')->placeholder('Enter Phone Number') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Email')->class('form-label') }}
|
||||
{{ html()->email('email')->class('form-control')->placeholder('Enter Email')->required() }}
|
||||
{{ html()->div('Please enter email')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Address')->class('form-label') }}
|
||||
{{ html()->text('address')->class('form-control')->placeholder('Enter Address')->required() }}
|
||||
{{ html()->div('Please enter address')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Shift')->class('form-label') }}
|
||||
{{ html()->text('shift')->class('form-control')->placeholder('Enter Shift')->required() }}
|
||||
{{ html()->div('Please enter Shift')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Salary')->class('form-label') }}
|
||||
{{ html()->text('salary')->class('form-control')->placeholder('Enter Salary')->required() }}
|
||||
{{ html()->div('Please enter salary')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Start Date')->class('form-label') }}
|
||||
<div class="input-group">
|
||||
{{ html()->text('start_date')->class('form-control flatpickr-date')->id('event-start-date')->placeholder('Event Start Date') }}
|
||||
<span class="input-group-text"><i class="ri-calendar-event-line"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('End Date')->class('form-label') }}
|
||||
<div class="input-group">
|
||||
{{ html()->text('end_date')->class('form-control flatpickr-date')->id('event-end-date')->placeholder('Event End Date') }}
|
||||
<span class="input-group-text"><i class="ri-calendar-event-line"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Remarks')->class('form-label') }}
|
||||
{{ html()->text('remark')->class('form-control')->placeholder('Enter Remarks')->required() }}
|
||||
{{ html()->div('Please enter remark')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
|
||||
<div class="mb-4 text-end">
|
||||
<button type="submit" class="btn btn-success w-sm">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
61
Modules/Training/resources/views/trainer/show.blade.php
Normal file
61
Modules/Training/resources/views/trainer/show.blade.php
Normal file
@ -0,0 +1,61 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card card-body p-4">
|
||||
<div>
|
||||
<div class="table-responsive">
|
||||
<table class="table-borderless mb-0 table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Trainer Name</span></th>
|
||||
<td>{{ $item->first_name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Phone</span></th>
|
||||
<td> {{ $item->phone }} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Email </span></th>
|
||||
<td>{{ $item->email }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Shift</span></th>
|
||||
<td>{{ $item->shift }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Start Date</span></th>
|
||||
<td>{{ Carbon::parse($item->start_date)->format('h:i A') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">End Date</span></th>
|
||||
<td>{{ Carbon::parse($item->end_date)->format('h:i A') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Status</span></th>
|
||||
<td>{{ Carbon::parse($item->status)->format('h:i A') }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 text-end">
|
||||
<a href="{{ route('meeting.index') }}" class="btn btn-secondary w-sm">Back</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
<!-- end page title -->
|
||||
|
||||
{{ html()->form('POST')->route('trainingList.store')->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
|
||||
|
||||
@include('training::training-list.partials.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
<!-- end page title -->
|
||||
|
||||
{{ html()->modelForm($trainingList, 'PUT')->route('trainingList.update', $trainingList->id)->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
|
||||
|
||||
@include('training::training-list.partials.action')
|
||||
|
||||
{{ html()->closeModelForm() }}
|
||||
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
@ -0,0 +1,78 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">Training Type</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('trainingList.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Training List</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Training Title</th>
|
||||
<th>Trainer</th>
|
||||
<th>Start Date</th>
|
||||
<th>End Date</th>
|
||||
<th>Training Members</th>
|
||||
<th>Shift</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($trainingLists as $key => $trainingList)
|
||||
<tr>
|
||||
<td>{{ $key + 1 }}</td>
|
||||
<td>{{ $trainingList->title }}</td>
|
||||
<td>{{ ($trainingList->trainer)->first_name }}</td>
|
||||
<td>{{ $trainingList->start_date }}</td>
|
||||
<td>{{ $trainingList->end_date }}</td>
|
||||
<td>{{ ($trainingList->employee)->first_name}}</td>
|
||||
<td>{{ $trainingList->shift}}</td>
|
||||
<td>
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
@can('trainingList.show')
|
||||
<a href="{{ route('trainingList.show', $trainingList->id) }}" class="link-info fs-15">
|
||||
<i class="ri-eye-line"></i>
|
||||
</a>
|
||||
@endcan
|
||||
@can('trainingList.edit')
|
||||
<a href="{{ route('trainingList.edit', $trainingList->id) }}"
|
||||
class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
|
||||
@endcan
|
||||
@can('trainingList.destroy')
|
||||
<a href="javascript:void(0);" data-link="{{ route('trainingList.destroy', $trainingList->id) }}"
|
||||
data-id="{{ $trainingList->id }}" class="link-danger fs-15 remove-item-btn"><i
|
||||
class="ri-delete-bin-line"></i></a>
|
||||
@endcan
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end row-->
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
@ -0,0 +1,99 @@
|
||||
<div class="row gy-3">
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Title')->class('form-label') }}
|
||||
{{ html()->text('title')->class('form-control')->placeholder('Training Title') }}
|
||||
</div>
|
||||
<div>
|
||||
<h1></h1>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{{ html()->label('Training By')->class('form-label') }}
|
||||
<div class="row mt-2">
|
||||
<div class="col-sm-3">
|
||||
<div class="form-check form-radio-success">
|
||||
{{ html()->radio('training_by', false, 'external')->class('form-check-input training-by')->checked($editable && $trainingList->training_by == 'external') }}
|
||||
{{ html()->label('External Trainer')->class('form-check-label me-1') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-check form-radio-success">
|
||||
{{ html()->radio('training_by', false, 'office')->class('form-check-input training-by')->checked($editable && $trainingList->training_by == 'office') }}
|
||||
{{ html()->label('Office Trainer')->class('form-check-label me-1') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6 external-dropdown d-none">
|
||||
{{ html()->label('Office Trainer')->class('form-label') }}
|
||||
{{ html()->select('assigned_id',$employee)->class('form-select select2')->placeholder('Office Trainer') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6 office-dropdown d-none">
|
||||
{{ html()->label('External Trainer')->class('form-label') }}
|
||||
{{ html()->select('trainer_id',$trainer)->class('form-select select2')->placeholder('External Trainer') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Training Members')->class('form-label') }}
|
||||
{{ html()->select('department_id',$department)->class('form-select select2')->placeholder('Training Members') }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Start Date')->class('form-label') }}
|
||||
<div class="input-group">
|
||||
{{ html()->text('start_date')->class('form-control flatpickr-date')->id('event-start-date')->placeholder('Training Start Date') }}
|
||||
<span class="input-group-text"><i class="ri-calendar-event-line"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('End Date')->class('form-label') }}
|
||||
<div class="input-group">
|
||||
{{ html()->text('end_date')->class('form-control flatpickr-date')->id('event-end-date')->placeholder('Training End Date') }}
|
||||
<span class="input-group-text"><i class="ri-calendar-event-line"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Shift')->class('form-label') }}
|
||||
{{ html()->text('shift')->class('form-control')->placeholder('Training Shift') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
{{ html()->label('Remarks')->class('form-label') }}
|
||||
{{ html()->textarea('remarks')->class('form-control')->placeholder('Training Remarks')->attributes(['rows' => 3]) }}
|
||||
</div>
|
||||
|
||||
<x-form-buttons :editable='$editable' label='Add' href="{{ route('trainingList.index') }}" />
|
||||
</div>
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('.training-by').change(function() {
|
||||
|
||||
let value = $(this).val();
|
||||
|
||||
console.log(value);
|
||||
|
||||
if (value == 'external') {
|
||||
$('.office-dropdown').removeClass('d-none');
|
||||
$('.external-dropdown').addClass('d-none');
|
||||
}
|
||||
if(value == 'office'){
|
||||
$('.office-dropdown').addClass('d-none');
|
||||
$('.external-dropdown').removeClass('d-none');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
<!-- end page title -->
|
||||
|
||||
{{ html()->form('POST')->route('trainingType.store')->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
|
||||
|
||||
@include('training::training-type.partials.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
@ -0,0 +1,72 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">Training Type</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('trainingType.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Training Type</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Training Type</th>
|
||||
<th>Status</th>
|
||||
<th>Remarks</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($trainingTypes as $key => $trainingType)
|
||||
<tr>
|
||||
<td>{{ $key + 1 }}</td>
|
||||
<td>{{ $trainingType->training_type }}</td>
|
||||
<td>{{ $trainingType->status }}</td>
|
||||
<td>{{ $trainingType->remarks }}</td>
|
||||
<td>
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
@can('trainingType.show')
|
||||
<a href="{{ route('trainingType.show', $trainingType->id) }}" class="link-info fs-15">
|
||||
<i class="ri-eye-line"></i>
|
||||
</a>
|
||||
@endcan
|
||||
@can('trainingType.edit')
|
||||
<a href="{{ route('trainingType.edit', $trainingType->id) }}"
|
||||
class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
|
||||
@endcan
|
||||
@can('trainingType.destroy')
|
||||
<a href="javascript:void(0);" data-link="{{ route('trainingType.destroy', $trainingType->id) }}"
|
||||
data-id="{{ $trainingType->id }}" class="link-danger fs-15 remove-item-btn"><i
|
||||
class="ri-delete-bin-line"></i></a>
|
||||
@endcan
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end row-->
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
@ -0,0 +1,39 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row gy-2">
|
||||
<p class="text-primary">Training Type</p>
|
||||
<hr>
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Training name')->class('form-label') }}
|
||||
{{ html()->text('training_type')->class('form-control')->placeholder('Enter Training Name')->required() }}
|
||||
{{ html()->div('Please enter Training Type name')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Status')->class('form-label') }}
|
||||
{{ html()->text('status')->class('form-control')->placeholder('Enter Status')->required() }}
|
||||
{{ html()->div('Please enter status')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Remarks')->class('form-label') }}
|
||||
{{ html()->text('remarks')->class('form-control')->placeholder('Enter Remarks')->required() }}
|
||||
{{ html()->div('Please enter remark')->class('invalid-feedback') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
|
||||
<div class="mb-4 text-end">
|
||||
<button type="submit" class="btn btn-success w-sm">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -0,0 +1,45 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card card-body p-4">
|
||||
<div>
|
||||
<div class="table-responsive">
|
||||
<table class="table-borderless mb-0 table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Training Name</span></th>
|
||||
<td>{{ $trainingType->training_type }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Status</span></th>
|
||||
<td> {{ $trainingType->status }} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Remarks </span></th>
|
||||
<td>{{ $trainingType->remarks }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 text-end">
|
||||
<a href="{{ route('trainingType.index') }}" class="btn btn-secondary w-sm">Back</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
0
Modules/Training/routes/.gitkeep
Normal file
0
Modules/Training/routes/.gitkeep
Normal file
19
Modules/Training/routes/api.php
Normal file
19
Modules/Training/routes/api.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Training\Http\Controllers\TrainingController;
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------
|
||||
* API Routes
|
||||
*--------------------------------------------------------------------------
|
||||
*
|
||||
* Here is where you can register API routes for your application. These
|
||||
* routes are loaded by the RouteServiceProvider within a group which
|
||||
* is assigned the "api" middleware group. Enjoy building your API!
|
||||
*
|
||||
*/
|
||||
|
||||
Route::middleware(['auth:sanctum'])->prefix('v1')->group(function () {
|
||||
Route::apiResource('training', TrainingController::class)->names('training');
|
||||
});
|
24
Modules/Training/routes/web.php
Normal file
24
Modules/Training/routes/web.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Training\Http\Controllers\TrainerController;
|
||||
use Modules\Training\Http\Controllers\TrainingListController;
|
||||
use Modules\Training\Http\Controllers\TrainingTypeController;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register web routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::group([], function () {
|
||||
Route::resource('trainer', TrainerController::class)->names('trainer');
|
||||
Route::resource('trainingType', TrainingTypeController::class)->names('trainingType');
|
||||
Route::resource('trainingList', TrainingListController::class)->names('trainingList');
|
||||
|
||||
});
|
26
Modules/Training/vite.config.js
Normal file
26
Modules/Training/vite.config.js
Normal file
@ -0,0 +1,26 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import laravel from 'laravel-vite-plugin';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
outDir: '../../public/build-training',
|
||||
emptyOutDir: true,
|
||||
manifest: true,
|
||||
},
|
||||
plugins: [
|
||||
laravel({
|
||||
publicDirectory: '../../public',
|
||||
buildDirectory: 'build-training',
|
||||
input: [
|
||||
__dirname + '/resources/assets/sass/app.scss',
|
||||
__dirname + '/resources/assets/js/app.js'
|
||||
],
|
||||
refresh: true,
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
//export const paths = [
|
||||
// 'Modules/Training/resources/assets/sass/app.scss',
|
||||
// 'Modules/Training/resources/assets/js/app.js',
|
||||
//];
|
Reference in New Issue
Block a user