Compare commits

...

4 Commits

79 changed files with 2274 additions and 579 deletions

View File

@ -0,0 +1,85 @@
<?php
namespace Modules\Admin\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\Admin\Repositories\AppreciationRepository;
class AppreciationController extends Controller
{
private $appreciationRepository;
public function __construct(AppreciationRepository $appreciationRepository)
{
$this->appreciationRepository = $appreciationRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = "Appreciation Lists";
$data['appreciationLists'] = $this->appreciationRepository->findAll();
return view('admin::appreciations.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = "Create Appreciation";
$data['editable'] = false;
return view('admin::appreciations.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
$this->appreciationRepository->create($request->all());
toastr()->success('Appreciation Created Successfully.');
return redirect()->route('appreciation.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('admin::appreciations.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = "Edit Appreciation";
$data['editable'] = true;
$data['appreciation'] = $this->appreciationRepository->getAppreciationById($id);
return view('admin::appreciations.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
$this->appreciationRepository->update($id, $request->all());
toastr()->success('Appreciation Updated Successfully.');
return redirect()->route('appreciation.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
}

View File

@ -0,0 +1,218 @@
<?php
namespace Modules\Admin\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use App\Service\CommonModelService;
use Log;
use Exception;
use Modules\Admin\Models\Departments;
class DepartmentsController extends Controller
{
protected $modelService;
public function __construct(Departments $model)
{
$this->modelService = new CommonModelService($model);
}
public function index(Request $request)
{
$data = Departments::where('status', '<>', -1)->orderBy('display_order')->get();
return view("admin::departments.index", compact('data'));
}
public function create(Request $request)
{
$TableData = Departments::where('status', '<>', -1)->orderBy('display_order')->get();
$editable = false;
return view("admin::departments.edit", compact('TableData', 'editable'));
}
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
//ADD REQUIRED FIELDS FOR VALIDATION
]);
if ($validator->fails()) {
return response()->json([
'error' => $validator->errors(),
], 500);
}
$request->request->add(['alias' => slugify($request->title)]);
$request->request->add(['display_order' => getDisplayOrder('tbl_departments')]);
$request->request->add(['created_at' => date("Y-m-d h:i:s")]);
$request->request->add(['updated_at' => date("Y-m-d h:i:s")]);
$requestData = $request->all();
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL') . '/', '', $value);
});
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL'), '', $value);
});
DB::beginTransaction();
try {
$operationNumber = getOperationNumber();
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
} catch (\Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DepartmentsController::class, 'store', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
if ($request->ajax()) {
return response()->json(['status' => true, 'message' => 'The Departments Created Successfully.'], 200);
}
return redirect()->route('department.index')->with('success', 'The Departments created Successfully.');
}
public function sort(Request $request)
{
$idOrder = $request->input('id_order');
foreach ($idOrder as $index => $id) {
$companyArticle = Departments::find($id);
$companyArticle->display_order = $index + 1;
$companyArticle->save();
}
return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200);
}
public function updatealias(Request $request)
{
$articleId = $request->input('articleId');
$newAlias = $request->input('newAlias');
$companyArticle = Departments::find($articleId);
if (!$companyArticle) {
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
}
$companyArticle->alias = $newAlias;
$companyArticle->save();
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
}
public function show(Request $request, $id)
{
$data = Departments::findOrFail($id);
return view("admin::departments.show", compact('data'));
}
public function edit(Request $request, $id)
{
$TableData = Departments::where('status', '<>', -1)->orderBy('display_order')->get();
$data = Departments::findOrFail($id);
$editable = true;
return view("admin::departments.edit", compact('data', 'TableData', 'editable'));
}
public function update(Request $request, $id)
{
$validator = Validator::make($request->all(), [
//ADD VALIDATION FOR REQIRED FIELDS
]);
if ($validator->fails()) {
return response()->json([
'error' => $validator->errors(),
], 500);
}
$requestData = $request->all();
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL') . '/', '', $value);
});
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL'), '', $value);
});
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('department_id'));
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DepartmentsController::class, 'update', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
if ($request->ajax()) {
return response()->json(['status' => true, 'message' => 'The Departments updated Successfully.'], 200);
}
// return redirect()->route('departments.index')->with('success','The Departments updated Successfully.');
return redirect()->back()->with('success', 'The Departments updated successfully.');
}
public function destroy(Request $request, $id)
{
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DepartmentsController::class, 'destroy', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
return response()->json(['status' => true, 'message' => 'The Departments Deleted Successfully.'], 200);
}
public function toggle(Request $request, $id)
{
$data = Departments::findOrFail($id);
$requestData = ['status' => ($data->status == 1) ? 0 : 1];
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id);
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DepartmentsController::class, 'destroy', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
return response()->json(['status' => true, 'message' => 'The Departments Deleted Successfully.'], 200);
}
public function clone(Request $request, $id)
{
$data = Departments::findOrFail($id);
unset($data['updatedby']);
unset($data['createdby']);
$requestData = $data->toArray();
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->create($OperationNumber, $OperationNumber, null, $requestData);
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DepartmentsController::class, 'clone', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
return response()->json(['status' => true, 'message' => 'The Departments Clonned Successfully.'], 200);
}
}

View File

@ -0,0 +1,209 @@
<?php
namespace Modules\Admin\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use App\Service\CommonModelService;
use Log;
use Exception;
use Modules\Admin\Models\Designations;
class DesignationsController extends Controller
{
protected $modelService;
public function __construct(Designations $model)
{
$this->modelService = new CommonModelService($model);
}
public function index(Request $request)
{
$data = Designations::where('status', '<>', -1)->orderBy('display_order')->get();
return view("admin::designations.index", compact('data'));
}
public function create(Request $request)
{
$TableData = Designations::where('status', '<>', -1)->orderBy('display_order')->get();
$editable = false;
return view("admin::designations.edit", compact('TableData', 'editable'));
}
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
//ADD REQUIRED FIELDS FOR VALIDATION
]);
if ($validator->fails()) {
return response()->json([
'error' => $validator->errors(),
], 500);
}
$request->request->add(['alias' => slugify($request->title)]);
$request->request->add(['display_order' => getDisplayOrder('tbl_designations')]);
$request->request->add(['created_at' => date("Y-m-d h:i:s")]);
$request->request->add(['updated_at' => date("Y-m-d h:i:s")]);
$requestData = $request->all();
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL') . '/', '', $value);
});
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL'), '', $value);
});
DB::beginTransaction();
try {
$operationNumber = getOperationNumber();
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
} catch (\Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DesignationsController::class, 'store', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
if ($request->ajax()) {
return response()->json(['status' => true, 'message' => 'The Designations Created Successfully.'], 200);
}
return redirect()->route('designation.index')->with('success', 'The Designations created Successfully.');
}
public function sort(Request $request)
{
$idOrder = $request->input('id_order');
foreach ($idOrder as $index => $id) {
$companyArticle = Designations::find($id);
$companyArticle->display_order = $index + 1;
$companyArticle->save();
}
return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200);
}
public function updatealias(Request $request)
{
$articleId = $request->input('articleId');
$newAlias = $request->input('newAlias');
$companyArticle = Designations::find($articleId);
if (!$companyArticle) {
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
}
$companyArticle->alias = $newAlias;
$companyArticle->save();
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
}
public function show(Request $request, $id)
{
$data = Designations::findOrFail($id);
return view("admin::designations.show", compact('data'));
}
public function edit(Request $request, $id)
{
$TableData = Designations::where('status', '<>', -1)->orderBy('display_order')->get();
$data = Designations::findOrFail($id);
$editable = true;
return view("admin::designations.edit", compact('data', 'TableData', 'editable'));
}
public function update(Request $request, $id)
{
$validator = Validator::make($request->all(), [
//ADD VALIDATION FOR REQIRED FIELDS
]);
if ($validator->fails()) {
return response()->json([
'error' => $validator->errors(),
], 500);
}
$requestData = $request->all();
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL') . '/', '', $value);
});
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL'), '', $value);
});
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('designation_id'));
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DesignationsController::class, 'update', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
if ($request->ajax()) {
return response()->json(['status' => true, 'message' => 'The Designations updated Successfully.'], 200);
}
// return redirect()->route('designations.index')->with('success','The Designations updated Successfully.');
return redirect()->back()->with('success', 'The Designations updated successfully.');
}
public function destroy(Request $request, $id)
{
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DesignationsController::class, 'destroy', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
return response()->json(['status' => true, 'message' => 'The Designations Deleted Successfully.'], 200);
}
public function toggle(Request $request, $id)
{
$data = Designations::findOrFail($id);
$requestData = ['status' => ($data->status == 1) ? 0 : 1];
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id);
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DesignationsController::class, 'destroy', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
return response()->json(['status' => true, 'message' => 'The Designations Deleted Successfully.'], 200);
}
public function clone(Request $request, $id)
{
$data = Designations::findOrFail($id);
unset($data['updatedby']);
unset($data['createdby']);
$requestData = $data->toArray();
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->create($OperationNumber, $OperationNumber, null, $requestData);
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DesignationsController::class, 'clone', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
return response()->json(['status' => true, 'message' => 'The Designations Clonned Successfully.'], 200);
}
}

View File

@ -0,0 +1,87 @@
<?php
namespace Modules\Admin\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\Admin\Repositories\PromotionDemotionRepository;
class PromotionDemotionController extends Controller
{
private $promotionDemotionRepository;
public function __construct(PromotionDemotionRepository $promotionDemotionRepository)
{
$this->promotionDemotionRepository = $promotionDemotionRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = "Promotion/ Demotion Lists";
$data['promotionDemotionLists'] = $this->promotionDemotionRepository->findAll();
return view('admin::promotiondemotions.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['editable'] = false;
$data['title'] = "Create Promotion/ Demotion";
return view('admin::promotiondemotions.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
$this->promotionDemotionRepository->create($request->all());
toastr()->success('Promotion/ Demotion Created Successfully');
return redirect()->route('promotionDemotion.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('admin::promotiondemotions.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['editable'] = false;
$data['title'] = "Edit Promotion/ Demotion";
$data['promotionDemotion'] = $this->promotionDemotionRepository->getPromotionDemotionById($id);
return view('admin::promotiondemotions.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
$this->promotionDemotionRepository->update($id, $request->all());
toastr()->success('Promotion/ Demotion Updated Successfully');
return redirect()->route('promotionDemotion.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
$this->promotionDemotionRepository->delete($id);
toastr()->success('Promotion/ Demotion Deleted Successfully');
return redirect()->route('promotionDemotion.index');
}
}

View File

@ -0,0 +1,83 @@
<?php
namespace Modules\Admin\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\Admin\Repositories\ResignationRepository;
class ResignationController extends Controller
{
private $resignationRepository;
public function __construct(ResignationRepository $resignationRepository)
{
$this->resignationRepository = $resignationRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = 'Resignation List';
$data['resignationLists'] = $this->resignationRepository->findAll();
return view('admin::resignations.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = 'Create Resignation';
$data['editable'] = false;
return view('admin::resignations.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
$this->resignationRepository->create($request->all());
return redirect()->route('resignation.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('admin::resignations.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = 'Edit Resignation';
$data['editable'] = true;
$data['resignation'] = $this->resignationRepository->getResignationById($id);
return view('admin::resignations.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
$this->resignationRepository->update($id, $request->all());
return redirect()->route('resignation.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace Modules\Admin\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Admin\Database\factories\AppreciationFactory;
class Appreciation extends Model
{
use HasFactory;
protected $table = 'tbl_appreciations';
protected $primaryKey = 'appreciation_id';
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'title',
'alias',
'type',
'employee_id',
'appreciated_by',
'appreciated_date',
'status',
'description',
'remarks',
];
}

View File

@ -1,6 +1,6 @@
<?php
namespace App\Models;
namespace Modules\Admin\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Models;
namespace Modules\Admin\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

View File

@ -0,0 +1,31 @@
<?php
namespace Modules\Admin\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Admin\Database\factories\PromotionDemotionFactory;
class PromotionDemotion extends Model
{
use HasFactory;
protected $table = "tbl_promotion_demotions";
protected $primaryKey = "promotion_demotion_id";
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'employee_id',
'title',
'employee_id',
'old_designation_id',
'new_designation_id',
'type',
'status',
'description',
'remarks',
];
}

View File

@ -0,0 +1,31 @@
<?php
namespace Modules\Admin\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Admin\Database\factories\ResignationFactory;
class Resignation extends Model
{
use HasFactory;
protected $table = 'tbl_resignations';
protected $primaryKey = 'resignation_id';
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'employee_id',
'resignation_date',
'approved_date',
'approved_by',
'description',
'remarks',
'status',
'createdBy',
'updatedBy',
];
}

View File

@ -0,0 +1,12 @@
<?php
namespace Modules\Admin\Repositories;
interface AppreciationInterface
{
public function findAll();
public function getAppreciationById($appreciationId);
public function delete($appreciationId);
public function create(array $AppreciationDetails);
public function update($appreciationId, array $newDetails);
}

View File

@ -0,0 +1,35 @@
<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Appreciation;
class AppreciationRepository implements AppreciationInterface
{
public function findAll()
{
return Appreciation::get();
}
public function getAppreciationById($appreciationId)
{
return Appreciation::findOrFail($appreciationId);
}
public function delete($appreciationId)
{
Appreciation::destroy($appreciationId);
}
public function create(array $appreciationDetails)
{
return Appreciation::create($appreciationDetails);
}
public function update($appreciationId, array $newDetails)
{
return Appreciation::where('appreciation_id', $appreciationId)->update($newDetails);
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace Modules\Admin\Repositories;
interface PromotionDemotionInterface
{
public function findAll();
public function getPromotionDemotionById($promotionDemotionId);
public function delete($promotionDemotionId);
public function create(array $PromotionDemotionDetails);
public function update($promotionDemotionId, array $newDetails);
}

View File

@ -0,0 +1,35 @@
<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\PromotionDemotion;
class PromotionDemotionRepository implements PromotionDemotionInterface
{
public function findAll()
{
return PromotionDemotion::get();
}
public function getPromotionDemotionById($promotionDemotionId)
{
return PromotionDemotion::findOrFail($promotionDemotionId);
}
public function delete($promotionDemotionId)
{
PromotionDemotion::destroy($promotionDemotionId);
}
public function create(array $promotionDemotionDetails)
{
return PromotionDemotion::create($promotionDemotionDetails);
}
public function update($promotionDemotionId, array $newDetails)
{
return PromotionDemotion::where('promotion_demotion_id', $promotionDemotionId)->update($newDetails);
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace Modules\Admin\Repositories;
interface ResignationInterface
{
public function findAll();
public function getResignationById($resignationId);
public function delete($resignationId);
public function create(array $ResignationDetails);
public function update($resignationId, array $newDetails);
}

View File

@ -0,0 +1,35 @@
<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Resignation;
class ResignationRepository implements ResignationInterface
{
public function findAll()
{
return Resignation::get();
}
public function getResignationById($resignationId)
{
return Resignation::findOrFail($resignationId);
}
public function delete($resignationId)
{
Resignation::destroy($resignationId);
}
public function create(array $resignationDetails)
{
return Resignation::create($resignationDetails);
}
public function update($resignationId, array $newDetails)
{
return Resignation::where('resignation_id', $resignationId)->update($newDetails);
}
}

View File

@ -4,6 +4,8 @@ namespace Modules\Admin\Services;
use Modules\Admin\Models\Castes;
use Modules\Admin\Models\Cities;
use Modules\Admin\Models\Country;
use Modules\Admin\Models\Departments;
use Modules\Admin\Models\Designations;
use Modules\Admin\Models\Districts;
use Modules\Admin\Models\Genders;
use Modules\Admin\Models\Nationalities;
@ -47,5 +49,14 @@ final class AdminService
return Nationalities::pluck('title', 'nationality_id');
}
function pluckDepartments()
{
return Departments::pluck('title', 'department_id');
}
function pluckDesignations()
{
return Designations::pluck('title', 'designation_id');
}
}

View File

@ -0,0 +1,38 @@
<?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_promotion_demotions', function (Blueprint $table) {
$table->tinyInteger('promotion_demotion_id')->unsigned()->autoIncrement();
$table->string('title')->nullable();
$table->string('alias')->nullable();
$table->unsignedBigInteger('employee_id')->nullable();
$table->unsignedBigInteger('old_designation_id')->nullable();
$table->unsignedBigInteger('new_designation_id')->nullable();
$table->unsignedBigInteger('type')->nullable();
$table->unsignedBigInteger('status')->nullable();
$table->date('date')->nullable();
$table->mediumText('description')->nullable();
$table->mediumText('remarks')->nullable();
$table->unsignedBigInteger('createdBy')->nullable();
$table->unsignedBigInteger('updatedBy')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tbl_promotion_demotions');
}
};

View File

@ -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_appreciations', function (Blueprint $table) {
$table->tinyInteger('appreciation_id')->unsigned()->autoIncrement();
$table->string('title')->nullable();
$table->string('alias')->nullable();
$table->string('type')->nullable();
$table->unsignedBigInteger('employee_id')->nullable();
$table->unsignedBigInteger('appreciated_by')->nullable();
$table->date('appreciated_date')->nullable();
$table->unsignedBigInteger('status')->nullable();
$table->mediumText('description')->nullable();
$table->mediumText('remarks')->nullable();
$table->unsignedBigInteger('createdBy')->nullable();
$table->unsignedBigInteger('updatedBy')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tbl_appreciations');
}
};

View File

@ -0,0 +1,35 @@
<?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_resignations', function (Blueprint $table) {
$table->tinyInteger('resignation_id')->unsigned()->autoIncrement();
$table->unsignedBigInteger('employee_id')->nullable();
$table->date('resignation_date')->nullable();
$table->date('approved_date')->nullable();
$table->unsignedBigInteger('approved_by')->nullable();
$table->mediumText('description')->nullable();
$table->mediumText('remarks')->nullable();
$table->unsignedBigInteger('status')->nullable();
$table->unsignedBigInteger('createdBy')->nullable();
$table->unsignedBigInteger('updatedBy')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tbl_resignations');
}
};

View 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 -->
<div class='card'>
<div class='card-body'>
{{ html()->form('POST')->route('appreciation.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.appreciations.action')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View 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 -->
<div class='card'>
<div class='card-body'>
{{ html()->modelForm($appreciation, 'PUT')->route('appreciation.update', $appreciation->appreciation_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.appreciations.action')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,75 @@
@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 -->
<div class="card">
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
<div class="flex-shrink-0">
<a href="{{ route('appreciation.create') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Create Appreciation</a>
</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">Employee</span></th>
<th class="tb-col"><span class="overline-title">Appreciated Type</span></th>
<th class="tb-col"><span class="overline-title">Appreciated By</span></th>
<th class="tb-col"><span class="overline-title">Appreciated Date</span></th>
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
</th>
</tr>
</thead>
<tbody>
@foreach ($appreciationLists as $index => $item)
<tr>
<td class="tb-col">{{ $index + 1 }}</td>
<td class="tb-col">{{ $item->employee_id }}</td>
<td class="tb-col">{{ $item->type }}</td>
<td class="tb-col">{{ $item->appreciated_by }}</td>
<td class="tb-col">{{ $item->appreciated_date }}</td>
<td class="tb-col">
<div class="dropdown d-inline-block">
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
aria-expanded="false">
<i class="ri-more-fill align-middle"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><a href="{{ route('appreciation.show', [$item->appreciation_id]) }}" class="dropdown-item"><i
class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
</li>
<li><a href="{{ route('appreciation.edit', [$item->appreciation_id]) }}"
class="dropdown-item edit-item-btn"><i
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
Edit</a>
</li>
<li>
<a href="{{ route('appreciation.destroy', [$item->appreciation_id]) }}"
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> Delete
</a>
</li>
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,48 @@
@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 -->
<div class='card'>
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
<div class="flex-shrink-0">
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<p><b>Job Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->job_description }}</span></p>
<p><b>Departments Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->departments_id }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,15 +1,14 @@
@extends('layouts.app')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2>
<?php createButton('btn-primary btn-cancel', '', 'Back to List', route('cities.index')); ?>
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
<div class="flex-shrink-0">
<a href="{{ route('cities.index') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
</div>
</div>
<div class='card-body'>
<p><b>Districts Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->districts_id }}</span></p>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>

View File

@ -9,10 +9,12 @@
<!-- end page title -->
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Detail'); ?></h2>
<?php createButton('btn-primary btn-cancel', '', 'Back to List', route('department.index')); ?>
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
<div class="flex-shrink-0">
<a href="{{ route('department.index') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>

View File

@ -0,0 +1,48 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => 'Designation'])
<!-- end page title -->
<div class='card'>
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
<div class="flex-shrink-0">
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<p><b>Job Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->job_description }}</span></p>
<p><b>Departments Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->departments_id }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,7 +1,7 @@
@extends('admin::layouts.master')
@section('content')
<h1>Hello World</h1>
<h1>Hello World</h1>
<p>Module: {!! config('admin.name') !!}</p>
<p>Module: {!! config('admin.name') !!}</p>
@endsection

View File

@ -0,0 +1,43 @@
<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('Enter Title') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Appreciation Type')->class('form-label') }}
{{ html()->select('type', [1 => 'Employee of the Month', 2 => 'Best Manger'])->class('form-select')->placeholder('Select Type') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Employee')->class('form-label') }}
{{ html()->select('employee_id')->class('form-select')->placeholder('Select Employee') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Appreciated By')->class('form-label') }}
{{ html()->select('appreciated_by')->class('form-select')->placeholder('Select Who Appreciated') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Appreciated Date')->class('form-label') }}
{{ html()->date('appreciated_date')->class('form-control')->placeholder('Select Date') }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Description')->class('form-label') }}
{{ html()->textarea('description')->class('form-control')->attributes(['rows' => 5]) }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Remarks')->class('form-label') }}
{{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 5]) }}
</div>
<div class="text-end">
{{ html()->button($editable ? 'Update' : 'Add Appreciation', 'submit')->class('btn btn-success') }}
</div>
</div>

View File

@ -0,0 +1,46 @@
<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('Enter Title') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Type')->class('form-label') }}
{{ html()->select('type', [1 => 'Promotion', 2 => 'Demotion'])->class('form-select')->placeholder('Select Type') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Employee')->class('form-label') }}
{{ html()->select('employee_id')->class('form-select')->placeholder('Select Employee') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Previous Designation')->class('form-label') }}
{{ html()->select('old_designation_id')->class('form-select')->placeholder('Select Previous Desgination') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('New Designation')->class('form-label') }}
{{ html()->select('new_designation_id')->class('form-select')->placeholder('Select New Desgination') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Date')->class('form-label') }}
{{ html()->date('date')->class('form-control')->placeholder('Select Date') }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Description')->class('form-label') }}
{{ html()->textarea('description')->class('form-control')->attributes(['rows' => 5]) }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Remarks')->class('form-label') }}
{{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 5]) }}
</div>
<div class="text-end">
{{ html()->button($editable ? 'Update' : 'Add Promotion/ Demotion', 'submit')->class('btn btn-success') }}
</div>
</div>

View File

@ -0,0 +1,26 @@
<div class="row gy-3">
<div class="col-lg-4 col-md-6">
{{ html()->label('Employee')->class('form-label') }}
{{ html()->select('employee_id')->class('form-select')->placeholder('Select Employee') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Resignation Date')->class('form-label') }}
{{ html()->date('resignation_date')->class('form-control')->placeholder('Select Resignation Date') }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Reason')->class('form-label') }}
{{ html()->textarea('description')->class('form-control')->placeholder('Write reason for resgination')->attributes(['rows' => 3]) }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Remarks')->class('form-label') }}
{{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 3]) }}
</div>
<div class="text-end">
{{ html()->button($editable ? 'Update' : 'Add Resignation', 'submit')->class('btn btn-success') }}
</div>
</div>

View 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 -->
<div class='card'>
<div class='card-body'>
{{ html()->form('POST')->route('promotionDemotion.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.promotiondemotions.action')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View 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 -->
<div class='card'>
<div class='card-body'>
{{ html()->modelForm($promotionDemotion, 'PUT')->route('promotionDemotion.update', $promotionDemotion->promotion_demotion_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.promotiondemotions.action')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,75 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => 'Promotion/ Demotion'])
<!-- end page title -->
<div class="card">
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">Promotion/ Demotion Lists</h5>
<div class="flex-shrink-0">
<a href="{{ route('promotionDemotion.create') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Create Promotion/ Demotion</a>
</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">Title</span></th>
<th class="tb-col"><span class="overline-title">Employee</span></th>
<th class="tb-col" width="20%"><span class="overline-title">Previous Designation</span></th>
<th class="tb-col" width="20%"><span class="overline-title">New Designation</span></th>
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
</th>
</tr>
</thead>
<tbody>
@foreach ($promotionDemotionLists as $index => $item)
<tr>
<td class="tb-col">{{ $index + 1 }}</td>
<td class="tb-col">{{ $item->title }}</td>
<td class="tb-col">{{ $item->employee_id }}</td>
<td class="tb-col">{{ $item->old_promotion_demotion_id }}</td>
<td class="tb-col">{{ $item->new_promotion_demotion_id }}</td>
<td class="tb-col">
<div class="dropdown d-inline-block">
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
aria-expanded="false">
<i class="ri-more-fill align-middle"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><a href="{{ route('promotionDemotion.show', [$item->promotion_demotion_id]) }}"
class="dropdown-item"><i class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
</li>
<li><a href="{{ route('promotionDemotion.edit', [$item->promotion_demotion_id]) }}"
class="dropdown-item edit-item-btn"><i
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
Edit</a>
</li>
<li>
<a href="{{ route('promotionDemotion.destroy', [$item->promotion_demotion_id]) }}"
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> Delete
</a>
</li>
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,48 @@
@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 -->
<div class='card'>
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
<div class="flex-shrink-0">
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<p><b>Job Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->job_description }}</span></p>
<p><b>Departments Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->departments_id }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
</div>
</div>
@endSection

View 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 -->
<div class='card'>
<div class='card-body'>
{{ html()->form('POST')->route('resignation.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.resignations.action')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View 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 -->
<div class='card'>
<div class='card-body'>
{{ html()->modelForm($resignation, 'PUT')->route('resignation.update', $resignation->resignation_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.resignations.action')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,77 @@
@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 -->
<div class="card">
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
<div class="flex-shrink-0">
<a href="{{ route('resignation.create') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Create Resignation</a>
</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">Employee</span></th>
<th class="tb-col"><span class="overline-title">Resignation Date</span></th>
<th class="tb-col"><span class="overline-title">Approved Date</span></th>
<th class="tb-col"><span class="overline-title">Approved By</span></th>
<th class="tb-col"><span class="overline-title">Status</span></th>
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
</th>
</tr>
</thead>
<tbody>
@foreach ($resignationLists as $index => $item)
<tr>
<td class="tb-col">{{ $index + 1 }}</td>
<td class="tb-col">{{ $item->employee_id }}</td>
<td class="tb-col">{{ $item->resignation_date }}</td>
<td class="tb-col">{{ $item->approved_date }}</td>
<td class="tb-col">{{ $item->approved_by }}</td>
<td class="tb-col">{{ $item->status }}</td>
<td class="tb-col">
<div class="dropdown d-inline-block">
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
aria-expanded="false">
<i class="ri-more-fill align-middle"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><a href="{{ route('resignation.show', [$item->resignation_id]) }}" class="dropdown-item"><i
class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
</li>
<li><a href="{{ route('resignation.edit', [$item->resignation_id]) }}"
class="dropdown-item edit-item-btn"><i
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
Edit</a>
</li>
<li>
<a href="{{ route('resignation.destroy', [$item->resignation_id]) }}"
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> Delete
</a>
</li>
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,48 @@
@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 -->
<div class='card'>
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
<div class="flex-shrink-0">
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<p><b>Job Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->job_description }}</span></p>
<p><b>Departments Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->departments_id }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
</div>
</div>
@endSection

View File

@ -2,6 +2,9 @@
use Illuminate\Support\Facades\Route;
use Modules\Admin\Http\Controllers\AdminController;
use Modules\Admin\Http\Controllers\AppreciationController;
use Modules\Admin\Http\Controllers\PromotionDemotionController;
use Modules\Admin\Http\Controllers\ResignationController;
/*
|--------------------------------------------------------------------------
@ -16,6 +19,9 @@ use Modules\Admin\Http\Controllers\AdminController;
Route::group([], function () {
Route::resource('admin', AdminController::class)->names('admin');
Route::resource('promotion-demotion', PromotionDemotionController::class)->names('promotionDemotion');
Route::resource('appreciation', AppreciationController::class)->names('appreciation');
Route::resource('resignation', ResignationController::class)->names('resignation');
});
require __DIR__ . '/route.countries.php';

View File

@ -45,8 +45,8 @@ class EmployeeController extends Controller
public function create()
{
$data['title'] = 'Create Employee';
$data['departmentList'] = [];
$data['designationList'] = [];
$data['departmentList'] = $this->adminService->pluckDepartments();
$data['designationList'] = $this->adminService->pluckDesignations();
$data['nationalityList'] = $this->adminService->pluckNationalities();
$data['genderList'] = $this->adminService->pluckGenders();
$data['casteList'] = $this->adminService->pluckCastes();

View File

@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
@ -43,6 +42,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('employees');
Schema::dropIfExists('tbl_employees');
}
};

View File

@ -27,7 +27,7 @@
<div class="col-md-4">
{{ html()->label('Gender')->class('form-label') }}
{{ html()->select('genders_id', [1 => 'male', 2 => 'female'])->class('form-select')->placeholder('Select Gender') }}
{{ html()->select('genders_id', $genderList)->class('form-select')->placeholder('Select Gender') }}
</div>
<div class="col-md-4">
@ -39,7 +39,7 @@
<div class="col-md-4">
{{ html()->label('Nationality')->class('form-label') }}
{{ html()->select('nationalities_id', [1 => 'Nepal', 2 => 'Other'])->class('form-control')->placeholder('Select Nationality') }}
{{ html()->select('nationality_id', $nationalityList)->class('form-select')->placeholder('Select Nationality') }}
</div>
<div class="col-md-4">
@ -91,12 +91,12 @@
<hr>
<div class="col-md-4">
{{ html()->label('Department')->class('form-label') }}
{{ html()->select('department_id', ['Nepal'])->class('form-select')->placeholder('Select Department') }}
{{ html()->select('department_id', $departmentList)->class('form-select')->placeholder('Select Department') }}
</div>
<div class="col-md-4">
{{ html()->label('Designation')->class('form-label') }}
{{ html()->select('designation_id', ['Nepal'])->class('form-select')->placeholder('Select Designation') }}
{{ html()->select('designation_id', $designationList)->class('form-select')->placeholder('Select Designation') }}
</div>
{{-- <div class="col-md-4">
@ -115,7 +115,6 @@
</div>
<!-- end card -->
<div class="mb-4 text-end">
<button type="submit" class="btn btn-success w-sm">Save</button>
</div>

View File

@ -5,19 +5,22 @@ namespace Modules\Leave\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Modules\Employee\Repositories\EmployeeInterface;
use Modules\Leave\Repositories\LeaveInterface;
use Modules\Employee\Repositories\EmployeeRepository;
use Modules\Leave\Repositories\LeaveRepository;
use Modules\Leave\Repositories\LeaveTypeRepository;
use Yoeunes\Toastr\Facades\Toastr;
class LeaveController extends Controller
{
private $leaveRepository;
private $employeeRepository;
private $leaveTypeRepository;
public function __construct(LeaveInterface $leaveRepository, EmployeeInterface $employeeRepository)
public function __construct(LeaveRepository $leaveRepository, EmployeeRepository $employeeRepository, LeaveTypeRepository $leaveTypeRepository)
{
$this->leaveRepository = $leaveRepository;
$this->employeeRepository = $employeeRepository;
$this->leaveTypeRepository = $leaveTypeRepository;
$this->middleware('role_or_permission:access leaves|create leaves|edit leaves|delete leaves', ['only' => ['index', 'show']]);
$this->middleware('role_or_permission:create leaves', ['only' => ['create', 'store']]);
@ -33,8 +36,7 @@ class LeaveController extends Controller
{
$data['leaves'] = $this->leaveRepository->findAll();
$data['employeeList'] = $this->employeeRepository->pluck();
return view('leave::index', $data);
return view('leave::leave.index', $data);
}
/**
@ -43,8 +45,10 @@ class LeaveController extends Controller
public function create()
{
$data['title'] = 'Create Leave';
$data['editable'] = false;
$data['employeeList'] = $this->employeeRepository->pluck();
return view('leave::create', $data);
$data['leaveTypeList'] = $this->leaveTypeRepository->pluck();
return view('leave::leave.create', $data);
}
/**
@ -67,7 +71,7 @@ class LeaveController extends Controller
*/
public function show($id)
{
return view('leave::show');
return view('leave::leave.show');
}
/**
@ -77,9 +81,11 @@ class LeaveController extends Controller
{
$data['title'] = 'Edit Leave';
$data['editable'] = true;
$data['leave'] = $this->leaveRepository->getLeaveById($id);
return view('leave::edit', $data);
return view('leave::leave.edit', $data);
}
/**

View File

@ -0,0 +1,88 @@
<?php
namespace Modules\Leave\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Modules\Leave\Repositories\LeaveTypeInterface;
class LeaveTypeController extends Controller
{
private $leaveTypeRepository;
public function __construct(LeaveTypeInterface $leaveTypeRepository)
{
$this->leaveTypeRepository = $leaveTypeRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = 'LeaveType List';
$data['leaveTypeLists'] = $this->leaveTypeRepository->findAll();
return view('leave::leave-type.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = 'Create LeaveType';
$data['editable'] = false;
return view('leave::leave-type.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
try {
$this->leaveTypeRepository->create($request->all());
return redirect()->route('leaveType.index')->with('success', 'Leave Type Created Successfully');
} catch (\Throwable $th) {
throw $th;
}
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('leave::leave-type.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['editable'] = false;
$data['title'] = 'Edit LeaveType';
return view('leave::leave-type.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace Modules\Leave\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class LeaveTypeRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
//
];
}
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
}

View File

@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class Leave extends Model
{
protected $table = 'leaves';
protected $table = 'tbl_leaves';
protected $primaryKey = 'leave_id';
protected $guarded = [];

View File

@ -0,0 +1,15 @@
<?php
namespace Modules\Leave\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class LeaveType extends Model
{
use HasFactory;
protected $table = 'tbl_leave_types';
protected $primaryKey = 'leave_type_id';
protected $guarded = [];
}

View File

@ -6,7 +6,8 @@ use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Modules\Leave\Repositories\LeaveInterface;
use Modules\Leave\Repositories\LeaveRepository;
use Modules\Leave\Repositories\LeaveTypeInterface;
use Modules\Leave\Repositories\LeaveTypeRepository;
class LeaveServiceProvider extends ServiceProvider
{
@ -33,6 +34,8 @@ class LeaveServiceProvider extends ServiceProvider
public function register(): void
{
$this->app->bind(LeaveInterface::class, LeaveRepository::class);
$this->app->bind(LeaveTypeInterface::class, LeaveTypeRepository::class);
$this->app->register(RouteServiceProvider::class);
}
@ -60,7 +63,7 @@ class LeaveServiceProvider extends ServiceProvider
*/
public function registerTranslations(): void
{
$langPath = resource_path('lang/modules/'.$this->moduleNameLower);
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
@ -76,7 +79,7 @@ class LeaveServiceProvider extends ServiceProvider
*/
protected function registerConfig(): void
{
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config');
$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);
}
@ -85,14 +88,14 @@ class LeaveServiceProvider extends ServiceProvider
*/
public function registerViews(): void
{
$viewPath = resource_path('views/modules/'.$this->moduleNameLower);
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'resources/views');
$this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-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','')));
$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);
}
@ -108,8 +111,8 @@ class LeaveServiceProvider extends ServiceProvider
{
$paths = [];
foreach (config('view.paths') as $path) {
if (is_dir($path.'/modules/'.$this->moduleNameLower)) {
$paths[] = $path.'/modules/'.$this->moduleNameLower;
if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
$paths[] = $path . '/modules/' . $this->moduleNameLower;
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Modules\Leave\Repositories;
interface LeaveTypeInterface
{
public function pluck();
public function findAll();
public function getLeaveTypeById($leaveTypeId);
public function delete($leaveTypeId);
public function create(array $LeaveTypeDetails);
public function update($leaveTypeId, array $newDetails);
}

View File

@ -0,0 +1,38 @@
<?php
namespace Modules\Leave\Repositories;
use Modules\Leave\Models\LeaveType;
class LeaveTypeRepository implements LeaveTypeInterface
{
public function pluck()
{
return LeaveType::pluck('title', 'leave_type_id');
}
public function findAll()
{
return LeaveType::get();
}
public function getLeaveTypeById($leaveTypeId)
{
return LeaveType::findOrFail($leaveTypeId);
}
public function delete($leaveTypeId)
{
LeaveType::destroy($leaveTypeId);
}
public function create(array $leaveTypeDetails)
{
return LeaveType::create($leaveTypeDetails);
}
public function update($leaveTypeId, array $newDetails)
{
return LeaveType::where('leave_type_id', $leaveTypeId)->update($newDetails);
}
}

View File

@ -4,18 +4,24 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('leaves', function (Blueprint $table) {
Schema::create('tbl_leaves', function (Blueprint $table) {
$table->tinyInteger('leave_id')->unsigned()->autoIncrement();
$table->integer('employee_id');
$table->date('start_date');
$table->date('end_date');
$table->unsignedBigInteger('employee_id');
$table->unsignedBigInteger('leave_type_id');
$table->date('start_date')->nullable();
$table->date('end_date')->nullable();
$table->date('leave_approved_date')->nullable();
$table->Integer('total_days')->nullable();
$table->unsignedBigInteger('leave_approved_by')->nullable();
$table->Integer('status')->nullable();
$table->longtext('description')->nullable();
$table->text('remarks')->nullable();
$table->timestamps();
});
}
@ -25,6 +31,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('leaves');
Schema::dropIfExists('tbl_leaves');
}
};

View File

@ -0,0 +1,31 @@
<?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_leave_types', function (Blueprint $table) {
$table->tinyInteger('leave_type_id')->unsigned()->autoIncrement();
$table->string('title');
$table->integer('status')->default(11);
$table->integer('createdBy')->nullable();
$table->integer('updatedBy')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tbl_leave_types');
}
};

View File

@ -0,0 +1,30 @@
@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 -->
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<form action="{{ route('leaveType.store') }}" class="needs-validation" novalidate method="post">
@csrf
@include('leave::leave-type.partials.action')
</form>
</div>
</div>
</div>
</div>
<!--end row-->
</div>
<!-- container-fluid -->
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,47 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
<h4 class="mb-sm-0">{{ $title }}</h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
<li class="breadcrumb-item active">{{ $title }}</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-8">
<div class="card">
<div class="card-body">
{{ html()->modelForm($leave, 'PUT')->route('leave.update', $leave->id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('leave::leave-type.partials.action')
{{ html()->closeModelForm() }}
</div>
</div>
</div>
</div>
<!--end row-->
</div>
<!-- container-fluid -->
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,67 @@
@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 -->
<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">LeaveType Lists</h5>
<div class="flex-shrink-0">
<a href="{{ route('leaveType.create') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Add</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>Title</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@forelse ($leaveTypeLists as $key => $leaveType)
<tr>
<td>{{ $key + 1 }}</td>
<td>{{ $leaveType->title }}</td>
<td>{{ $leaveType->created_at }}</td>
<td>
<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('leaveType.edit', $leaveType->leave_type_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('leaveType.destroy', $leaveType->leave_type_id) }}"
data-id="{{ $leaveType->leave_type_id }}" class="link-danger fs-15 remove-item-btn"><i
class="ri-delete-bin-line"></i></a>
</div>
</td>
</tr>
@empty
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!--end row-->
</div>
</div>
@endsection

View File

@ -0,0 +1,14 @@
<div class="row">
<div class="col-md-4">
{{ html()->label('Title')->class('form-label') }}
{{ html()->text('title')->class('form-control')->placeholder('Enter Leave Type') }}
</div>
</div>
<div class="text-end">
<button type="submit" class="btn btn-primary">{{ $editable ? 'Update' : 'Add Leave Type' }}</button>
</div>
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,16 @@
<div class="modal fade" id="viewModal" tabindex="-1" aria-labelledby="viewModalLabel" aria-modal="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalgridLabel">View Leave</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form action="{{ route('leave-t.store') }}" class="needs-validation" novalidate method="post">
@csrf
@include('leave::leave.partials.action')
</form>
</div>
</div>
</div>
</div>

View File

@ -7,12 +7,12 @@
@include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title -->
<div class="row">
<div class="col-lg-8">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<form action="{{ route('leave.store') }}" class="needs-validation" novalidate method="post">
@csrf
@include('leave::partials.action')
@include('leave::leave.partials.action')
</form>
</div>
</div>

View File

@ -15,7 +15,6 @@
<li class="breadcrumb-item active">{{ $title }}</li>
</ol>
</div>
</div>
</div>
</div>
@ -27,7 +26,7 @@
{{ html()->modelForm($leave, 'PUT')->route('leave.update', $leave->id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('leave::partials.action')
@include('leave::leave.partials.action')
{{ html()->closeModelForm() }}

View File

@ -50,7 +50,7 @@
<h5 class="card-title flex-grow-1 mb-0">Leave Lists</h5>
<div class="flex-shrink-0">
<a href="{{ route('leave.create') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Add</a>
class="ri-add-fill me-1 align-bottom"></i> Apply Leave</a>
</div>
</div>
@ -104,5 +104,5 @@
</div>
</div>
<!-- container-fluid -->
@include('leave::partials.view')
{{-- @include('leave::leave.partials.view') --}}
@endsection

View File

@ -0,0 +1,34 @@
<div class="row g-2">
<div class="col-md-6">
{{ html()->label('Leave Type')->class('form-label') }}
{{ html()->select('leave_type_id', $leaveTypeList)->class('form-select')->placeholder('Select Leave Type') }}
</div>
<div class="col-md-6">
{{ html()->label('Employee')->class('form-label') }}
{{ html()->select('employee_id', [1 => 'Deepak'])->class('form-select')->placeholder('Select Employee') }}
</div>
<div class="col-md-6">
{{ html()->label('Start Date')->class('form-label') }}
{{ html()->date('start_date')->class('form-control')->placeholder('Select Start Date') }}
</div>
<div class="col-md-6">
{{ html()->label('Start Date')->class('form-label') }}
{{ html()->date('end_date')->class('form-control')->placeholder('Select Start Date') }}
</div>
<div class="col-md-12">
{{ html()->label('Description')->class('form-label') }}
{{ html()->textarea('description')->class('form-control')->placeholder('Write Reason for Leave') }}
</div>
<div class="text-end">
{{ html()->button($editable ? 'Update' : 'Add Leave', 'submit')->class('btn btn-success') }}
</div>
</div>
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -8,7 +8,7 @@
<div class="modal-body">
<form action="{{ route('leave.store') }}" class="needs-validation" novalidate method="post">
@csrf
@include('leave::partials.action')
@include('leave::leave.partials.action')
</form>
</div>
</div>

View File

@ -1,25 +0,0 @@
<div class="mb-3">
<label for="employee_id" class="form-label">Employee Name</label>
{{ html()->select('employee_id', $employeeList)->class('form-select')->placeholder('Select Employee') }}
</div>
<div class="mb-3">
<label for="start_date" class="form-label">Start Leave Date</label>
<input type="date" class="form-control" id="start_date" name="start_date"
value="{{ old('start_date', $leave->start_date ?? '') }}">
</div>
<div class="mb-3">
<label for="end_date" class="form-label">End Leave Date</label>
<input type="date" class="form-control" id="end_date" name="end_date"
value="{{ old('end_date', $leave->end_date ?? '') }}">
</div>
<div class="text-end">
<button type="submit" class="btn btn-primary">{{ isset($leave) ? 'Update' : 'Add Leave' }}</button>
</div>
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -2,6 +2,7 @@
use Illuminate\Support\Facades\Route;
use Modules\Leave\Http\Controllers\LeaveController;
use Modules\Leave\Http\Controllers\LeaveTypeController;
/*
|--------------------------------------------------------------------------
@ -12,8 +13,9 @@ use Modules\Leave\Http\Controllers\LeaveController;
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
*/
Route::group([], function () {
Route::resource('leave', LeaveController::class)->names('leave');
Route::resource('leave-type', LeaveTypeController::class)->names('leaveType');
});

View File

@ -47,12 +47,13 @@ class OMIS
$activeClass = $isActive ? 'active' : '';
?>
<li>
<a class="nav-link menu-link <?php echo $activeClass; ?>" href="<?php echo $URL; ?>"><i class="ri-file-text-line "></i> <span data-key="t-landing">
<a class="nav-link menu-link <?php echo $activeClass; ?>" href="<?php echo $URL; ?>"><i
class="ri-file-text-line "></i> <span data-key="t-landing">
<?php echo $text; ?>
</span></a>
</li>
<?php
}
<?php
}
public static function getSiteVars()
{
@ -659,6 +660,7 @@ class OMIS
CREATE TABLE IF NOT EXISTS `tbl_designations` (
`designation_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`title` varchar(255) DEFAULT NULL,
`salary` DECIMAL(10, 2) DEFAULT NULL,
`alias` varchar(255) DEFAULT NULL,
`status` int(11) DEFAULT NULL,
`remarks` text DEFAULT NULL,

View File

@ -1,217 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Departments;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use App\Service\CommonModelService;
use Log;
use Exception;
class DepartmentsController extends Controller
{
protected $modelService;
public function __construct(Departments $model)
{
$this->modelService = new CommonModelService($model);
}
public function index(Request $request)
{
$data = Departments::where('status','<>',-1)->orderBy('display_order')->get();
return view("crud.generated.departments.index", compact('data'));
}
public function create(Request $request)
{
$TableData = Departments::where('status','<>',-1)->orderBy('display_order')->get();
$editable=false;
return view("crud.generated.departments.edit",compact('TableData','editable'));
}
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
//ADD REQUIRED FIELDS FOR VALIDATION
]);
if ($validator->fails()) {
return response()->json([
'error' => $validator->errors(),
],500);
}
$request->request->add(['alias' => slugify($request->title)]);
$request->request->add(['display_order' => getDisplayOrder('tbl_departments')]);
$request->request->add(['created_at' => date("Y-m-d h:i:s")]);
$request->request->add(['updated_at' => date("Y-m-d h:i:s")]);
$requestData=$request->all();
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL').'/', '', $value);
});
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL'), '', $value);
});
DB::beginTransaction();
try {
$operationNumber = getOperationNumber();
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
} catch (\Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DepartmentsController::class, 'store', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
if ($request->ajax()) {
return response()->json(['status' => true, 'message' => 'The Departments Created Successfully.'], 200);
}
return redirect()->route('department.index')->with('success','The Departments created Successfully.');
}
public function sort(Request $request)
{
$idOrder = $request->input('id_order');
foreach ($idOrder as $index => $id) {
$companyArticle = Departments::find($id);
$companyArticle->display_order = $index + 1;
$companyArticle->save();
}
return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200);
}
public function updatealias(Request $request)
{
$articleId = $request->input('articleId');
$newAlias = $request->input('newAlias');
$companyArticle = Departments::find($articleId);
if (!$companyArticle) {
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
}
$companyArticle->alias = $newAlias;
$companyArticle->save();
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
}
public function show(Request $request, $id)
{
$data = Departments::findOrFail($id);
return view("crud.generated.departments.show", compact('data'));
}
public function edit(Request $request, $id)
{
$TableData = Departments::where('status','<>',-1)->orderBy('display_order')->get();
$data = Departments::findOrFail($id);
$editable=true;
return view("crud.generated.departments.edit", compact('data','TableData','editable'));
}
public function update(Request $request, $id)
{
$validator = Validator::make($request->all(), [
//ADD VALIDATION FOR REQIRED FIELDS
]);
if ($validator->fails()) {
return response()->json([
'error' => $validator->errors(),
],500);
}
$requestData=$request->all();
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL').'/', '', $value);
});
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL'), '', $value);
});
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('department_id'));
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DepartmentsController::class, 'update', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
if ($request->ajax()) {
return response()->json(['status' => true, 'message' => 'The Departments updated Successfully.'], 200);
}
// return redirect()->route('departments.index')->with('success','The Departments updated Successfully.');
return redirect()->back()->with('success', 'The Departments updated successfully.');
}
public function destroy(Request $request,$id)
{
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DepartmentsController::class, 'destroy', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
return response()->json(['status'=>true,'message'=>'The Departments Deleted Successfully.'],200);
}
public function toggle(Request $request,$id)
{
$data = Departments::findOrFail($id);
$requestData=['status'=>($data->status==1)?0:1];
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id);
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DepartmentsController::class, 'destroy', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
return response()->json(['status'=>true,'message'=>'The Departments Deleted Successfully.'],200);
}
public function clone(Request $request,$id)
{
$data = Departments::findOrFail($id);
unset($data['updatedby']);
unset($data['createdby']);
$requestData=$data->toArray();
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->create($OperationNumber, $OperationNumber, null, $requestData);
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DepartmentsController::class, 'clone', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
return response()->json(['status'=>true,'message'=>'The Departments Clonned Successfully.'],200);
}
}

View File

@ -1,208 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Designations;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use App\Service\CommonModelService;
use Log;
use Exception;
class DesignationsController extends Controller
{
protected $modelService;
public function __construct(Designations $model)
{
$this->modelService = new CommonModelService($model);
}
public function index(Request $request)
{
$data = Designations::where('status','<>',-1)->orderBy('display_order')->get();
return view("crud.generated.designations.index", compact('data'));
}
public function create(Request $request)
{
$TableData = Designations::where('status','<>',-1)->orderBy('display_order')->get();
$editable=false;
return view("crud.generated.designations.edit",compact('TableData','editable'));
}
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
//ADD REQUIRED FIELDS FOR VALIDATION
]);
if ($validator->fails()) {
return response()->json([
'error' => $validator->errors(),
],500);
}
$request->request->add(['alias' => slugify($request->title)]);
$request->request->add(['display_order' => getDisplayOrder('tbl_designations')]);
$request->request->add(['created_at' => date("Y-m-d h:i:s")]);
$request->request->add(['updated_at' => date("Y-m-d h:i:s")]);
$requestData=$request->all();
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL').'/', '', $value);
});
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL'), '', $value);
});
DB::beginTransaction();
try {
$operationNumber = getOperationNumber();
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
} catch (\Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DesignationsController::class, 'store', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
if ($request->ajax()) {
return response()->json(['status' => true, 'message' => 'The Designations Created Successfully.'], 200);
}
return redirect()->route('designation.index')->with('success','The Designations created Successfully.');
}
public function sort(Request $request)
{
$idOrder = $request->input('id_order');
foreach ($idOrder as $index => $id) {
$companyArticle = Designations::find($id);
$companyArticle->display_order = $index + 1;
$companyArticle->save();
}
return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200);
}
public function updatealias(Request $request)
{
$articleId = $request->input('articleId');
$newAlias = $request->input('newAlias');
$companyArticle = Designations::find($articleId);
if (!$companyArticle) {
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
}
$companyArticle->alias = $newAlias;
$companyArticle->save();
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
}
public function show(Request $request, $id)
{
$data = Designations::findOrFail($id);
return view("crud.generated.designations.show", compact('data'));
}
public function edit(Request $request, $id)
{
$TableData = Designations::where('status','<>',-1)->orderBy('display_order')->get();
$data = Designations::findOrFail($id);
$editable=true;
return view("crud.generated.designations.edit", compact('data','TableData','editable'));
}
public function update(Request $request, $id)
{
$validator = Validator::make($request->all(), [
//ADD VALIDATION FOR REQIRED FIELDS
]);
if ($validator->fails()) {
return response()->json([
'error' => $validator->errors(),
],500);
}
$requestData=$request->all();
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL').'/', '', $value);
});
array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL'), '', $value);
});
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('designation_id'));
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DesignationsController::class, 'update', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
if ($request->ajax()) {
return response()->json(['status' => true, 'message' => 'The Designations updated Successfully.'], 200);
}
// return redirect()->route('designations.index')->with('success','The Designations updated Successfully.');
return redirect()->back()->with('success', 'The Designations updated successfully.');
}
public function destroy(Request $request,$id)
{
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DesignationsController::class, 'destroy', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
return response()->json(['status'=>true,'message'=>'The Designations Deleted Successfully.'],200);
}
public function toggle(Request $request,$id)
{
$data = Designations::findOrFail($id);
$requestData=['status'=>($data->status==1)?0:1];
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id);
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DesignationsController::class, 'destroy', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
return response()->json(['status'=>true,'message'=>'The Designations Deleted Successfully.'],200);
}
public function clone(Request $request,$id)
{
$data = Designations::findOrFail($id);
unset($data['updatedby']);
unset($data['createdby']);
$requestData=$data->toArray();
DB::beginTransaction();
try {
$OperationNumber = getOperationNumber();
$this->modelService->create($OperationNumber, $OperationNumber, null, $requestData);
} catch (Exception $e) {
DB::rollBack();
Log::info($e->getMessage());
createErrorLog(DesignationsController::class, 'clone', $e->getMessage());
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
}
DB::commit();
return response()->json(['status'=>true,'message'=>'The Designations Clonned Successfully.'],200);
}
}

View File

@ -1,38 +0,0 @@
@extends('layouts.app')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2>
<?php createButton('btn-primary btn-cancel', '', 'Back to List', route('designations.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<p><b>Job Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->job_description }}</span></p>
<p><b>Departments Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->departments_id }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -86,9 +86,25 @@
</li>
<li class="nav-item">
<a class="nav-link @if (\Request::is('leave') || \Request::is('leave/*')) active @endif" href="{{ route('leave.index') }}">
<i class="ri-honour-line"></i> <span data-key="t-widgets">Leave</span>
<a class="nav-link menu-link" href="#leave" data-bs-toggle="collapse" role="button" aria-expanded="false"
aria-controls="leave">
<i class="ri-shopping-cart-2-line"></i> <span data-key="t-vendors">Leave</span>
</a>
<div class="menu-dropdown collapse" id="leave">
<ul class="nav nav-sm flex-column">
<li class="nav-item">
<a href="{{ route('leaveType.index') }}"
class="nav-link @if (\Request::is('leavetype') || \Request::is('leavetype/*')) active @endif">Leave Type</a>
</li>
<li class="nav-item">
<a href="{{ route('leave.index') }}"
class="nav-link @if (\Request::is('leave') || \Request::is('leave/*')) active @endif">Apply Leave</a>
</li>
</ul>
</div>
</li>
<li class="nav-item">
@ -109,6 +125,21 @@
class="nav-link @if (\Request::is('role') || \Request::is('role/*')) active @endif">Roles</a>
</li>
<li class="nav-item">
<a href="{{ route('promotionDemotion.index') }}"
class="nav-link @if (\Request::is('promotion-demotion') || \Request::is('promotion-demotion/*')) active @endif">Promotion/ Demotions</a>
</li>
<li class="nav-item">
<a href="{{ route('appreciation.index') }}"
class="nav-link @if (\Request::is('appreciation') || \Request::is('appreciation/*')) active @endif">Appreciations</a>
</li>
<li class="nav-item">
<a href="{{ route('resignation.index') }}"
class="nav-link @if (\Request::is('resignation') || \Request::is('resignation/*')) active @endif">Resignations</a>
</li>
<li class="nav-item">
<a href="{{ route('countries.index') }}"
class="nav-link @if (\Request::is('country') || \Request::is('country/*')) active @endif">Countries</a>

View File

@ -1,16 +1,17 @@
<?php
use App\Http\Controllers\DepartmentsController;
use Illuminate\Support\Facades\Route;
use Modules\Admin\Http\Controllers\DepartmentsController;
Route::prefix("department")->group(function () {
Route::get('/', [DepartmentsController::class, 'index'])->name('department.index');
Route::get('/create', [DepartmentsController::class, 'create'])->name('department.create');
Route::post('/store', [DepartmentsController::class, 'store'])->name('department.store');
Route::post('/sort', [DepartmentsController::class, 'sort'])->name('department.sort');
Route::post('/updatealias', [DepartmentsController::class, 'updatealias'])->name('department.updatealias');
Route::get('/show/{id}', [DepartmentsController::class, 'show'])->name('department.show');
Route::get('/edit/{id}', [DepartmentsController::class, 'edit'])->name('department.edit') ;
Route::post('/update/{id}', [DepartmentsController::class, 'update'])->name('department.update');
Route::get('/destroy/{id}', [DepartmentsController::class, 'destroy'])->name('department.destroy');
Route::get('/toggle/{id}', [DepartmentsController::class, 'toggle'])->name('department.toggle');
Route::get('/clone/{id}', [DepartmentsController::class, 'clone'])->name('department.clone');
});
Route::get('/', [DepartmentsController::class, 'index'])->name('department.index');
Route::get('/create', [DepartmentsController::class, 'create'])->name('department.create');
Route::post('/store', [DepartmentsController::class, 'store'])->name('department.store');
Route::post('/sort', [DepartmentsController::class, 'sort'])->name('department.sort');
Route::post('/updatealias', [DepartmentsController::class, 'updatealias'])->name('department.updatealias');
Route::get('/show/{id}', [DepartmentsController::class, 'show'])->name('department.show');
Route::get('/edit/{id}', [DepartmentsController::class, 'edit'])->name('department.edit');
Route::post('/update/{id}', [DepartmentsController::class, 'update'])->name('department.update');
Route::get('/destroy/{id}', [DepartmentsController::class, 'destroy'])->name('department.destroy');
Route::get('/toggle/{id}', [DepartmentsController::class, 'toggle'])->name('department.toggle');
Route::get('/clone/{id}', [DepartmentsController::class, 'clone'])->name('department.clone');
});

View File

@ -1,16 +1,17 @@
<?php
use App\Http\Controllers\DesignationsController;
use Illuminate\Support\Facades\Route;
Route::prefix("designation")->group(function () {
Route::get('/', [DesignationsController::class, 'index'])->name('designation.index');
Route::get('/create', [DesignationsController::class, 'create'])->name('designation.create');
Route::post('/store', [DesignationsController::class, 'store'])->name('designation.store');
Route::post('/sort', [DesignationsController::class, 'sort'])->name('designation.sort');
Route::post('/updatealias', [DesignationsController::class, 'updatealias'])->name('designation.updatealias');
Route::get('/show/{id}', [DesignationsController::class, 'show'])->name('designation.show');
Route::get('/edit/{id}', [DesignationsController::class, 'edit'])->name('designation.edit') ;
Route::post('/update/{id}', [DesignationsController::class, 'update'])->name('designation.update');
Route::get('/destroy/{id}', [DesignationsController::class, 'destroy'])->name('designation.destroy');
Route::get('/toggle/{id}', [DesignationsController::class, 'toggle'])->name('designation.toggle');
Route::get('/clone/{id}', [DesignationsController::class, 'clone'])->name('designation.clone');
});
use Modules\Admin\Http\Controllers\DesignationsController;
Route::prefix("designation")->as('designation.')->group(function () {
Route::get('/', [DesignationsController::class, 'index'])->name('index');
Route::get('/create', [DesignationsController::class, 'create'])->name('create');
Route::post('/store', [DesignationsController::class, 'store'])->name('store');
Route::post('/sort', [DesignationsController::class, 'sort'])->name('sort');
Route::post('/updatealias', [DesignationsController::class, 'updatealias'])->name('updatealias');
Route::get('/show/{id}', [DesignationsController::class, 'show'])->name('show');
Route::get('/edit/{id}', [DesignationsController::class, 'edit'])->name('edit');
Route::post('/update/{id}', [DesignationsController::class, 'update'])->name('update');
Route::get('/destroy/{id}', [DesignationsController::class, 'destroy'])->name('destroy');
Route::get('/toggle/{id}', [DesignationsController::class, 'toggle'])->name('toggle');
Route::get('/clone/{id}', [DesignationsController::class, 'clone'])->name('clone');
});