diff --git a/Modules/Admin/app/Http/Controllers/.gitkeep b/Modules/Admin/app/Http/Controllers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Admin/app/Http/Controllers/AdminController.php b/Modules/Admin/app/Http/Controllers/AdminController.php new file mode 100644 index 0000000..06b04fe --- /dev/null +++ b/Modules/Admin/app/Http/Controllers/AdminController.php @@ -0,0 +1,67 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + // createActivityLog(CastesController::class, 'index', ' Castes index'); + $data = Castes::where('status', '<>', -1)->orderBy('display_order')->get(); + + return view("admin::castes.index", compact('data')); + } + + public function create(Request $request) + { + // createActivityLog(CastesController::class, 'create', ' Castes create'); + $TableData = Castes::where('status', '<>', -1)->orderBy('display_order')->get(); + $editable = false; + return view("admin::castes.edit", compact('TableData', 'editable')); + } + + public function store(Request $request) + { + // createActivityLog(CastesController::class, 'store', ' Castes store'); + $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_castes')]); + $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(CastesController::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 Castes Created Successfully.'], 200); + } + return redirect()->route('castes.index')->with('success', 'The Castes created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Castes::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 = Castes::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) + { + // createActivityLog(CastesController::class, 'show', ' Castes show'); + $data = Castes::findOrFail($id); + + return view("admin::castes.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + // createActivityLog(CastesController::class, 'edit', ' Castes edit'); + $TableData = Castes::where('status', '<>', -1)->orderBy('display_order')->get(); + $data = Castes::findOrFail($id); + $editable = true; + return view("admin::castes.edit", compact('data', 'TableData', 'editable')); + } + + + public function update(Request $request, $id) + { + // createActivityLog(CastesController::class, 'update', ' Castes update'); + $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('caste_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CastesController::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 Castes updated Successfully.'], 200); + } + // return redirect()->route('castes.index')->with('success','The Castes updated Successfully.'); + return redirect()->back()->with('success', 'The Castes updated successfully.'); + } + + public function destroy(Request $request, $id) + { + // createActivityLog(CastesController::class, 'destroy', ' Castes destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CastesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Castes Deleted Successfully.'], 200); + } + public function toggle(Request $request, $id) + { + // createActivityLog(CastesController::class, 'destroy', ' Castes destroy'); + $data = Castes::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(CastesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Castes Deleted Successfully.'], 200); + } + public function clone(Request $request, $id) + { + // createActivityLog(CastesController::class, 'clone', ' Castes clone'); + $data = Castes::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(CastesController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Castes Clonned Successfully.'], 200); + } + + + +} diff --git a/Modules/Admin/app/Http/Controllers/CitiesController.php b/Modules/Admin/app/Http/Controllers/CitiesController.php new file mode 100644 index 0000000..630bf09 --- /dev/null +++ b/Modules/Admin/app/Http/Controllers/CitiesController.php @@ -0,0 +1,219 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + // createActivityLog(CitiesController::class, 'index', ' Cities index'); + $data = Cities::where('status', '<>', -1)->orderBy('display_order')->get(); + + return view("admin::cities.index", compact('data')); + } + + public function create(Request $request) + { + // createActivityLog(CitiesController::class, 'create', ' Cities create'); + $TableData = Cities::where('status', '<>', -1)->orderBy('display_order')->get(); + $editable = false; + return view("admin::cities.edit", compact('TableData', 'editable')); + } + + public function store(Request $request) + { + // createActivityLog(CitiesController::class, 'store', ' Cities store'); + $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_cities')]); + $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(CitiesController::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 Cities Created Successfully.'], 200); + } + return redirect()->route('cities.index')->with('success', 'The Cities created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Cities::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 = Cities::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) + { + // createActivityLog(CitiesController::class, 'show', ' Cities show'); + $data = Cities::findOrFail($id); + + return view("admin::cities.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + // createActivityLog(CitiesController::class, 'edit', ' Cities edit'); + $TableData = Cities::where('status', '<>', -1)->orderBy('display_order')->get(); + $data = Cities::findOrFail($id); + $editable = true; + return view("admin::cities.edit", compact('data', 'TableData', 'editable')); + } + + + public function update(Request $request, $id) + { + // createActivityLog(CitiesController::class, 'update', ' Cities update'); + $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('city_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CitiesController::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 Cities updated Successfully.'], 200); + } + // return redirect()->route('cities.index')->with('success','The Cities updated Successfully.'); + return redirect()->back()->with('success', 'The Cities updated successfully.'); + } + + public function destroy(Request $request, $id) + { + // createActivityLog(CitiesController::class, 'destroy', ' Cities destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CitiesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Cities Deleted Successfully.'], 200); + } + public function toggle(Request $request, $id) + { + // createActivityLog(CitiesController::class, 'destroy', ' Cities destroy'); + $data = Cities::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(CitiesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Cities Deleted Successfully.'], 200); + } + public function clone(Request $request, $id) + { + // createActivityLog(CitiesController::class, 'clone', ' Cities clone'); + $data = Cities::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(CitiesController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Cities Clonned Successfully.'], 200); + } + + + +} diff --git a/app/Http/Controllers/CountriesController.php b/Modules/Admin/app/Http/Controllers/CountriesController.php similarity index 94% rename from app/Http/Controllers/CountriesController.php rename to Modules/Admin/app/Http/Controllers/CountriesController.php index 0a99ab2..fc3710c 100644 --- a/app/Http/Controllers/CountriesController.php +++ b/Modules/Admin/app/Http/Controllers/CountriesController.php @@ -1,14 +1,15 @@ ', -1)->orderBy('display_order')->get(); - return view("crud.generated.countries.index", compact('data')); + return view("admin::countries.index", compact('data')); } public function create(Request $request) { // createActivityLog(CountriesController::class, 'create', ' Country create'); - $TableData = Country::where('status', '<>', -1)->orderBy('display_order')->get(); $editable = false; - return view("crud.generated.countries.edit", compact('TableData', 'editable')); + return view("admin::countries.edit", compact('editable')); } public function store(Request $request) @@ -104,7 +104,7 @@ class CountriesController extends Controller // createActivityLog(CountriesController::class, 'show', ' Country show'); $data = Country::findOrFail($id); - return view("crud.generated.countries.show", compact('data')); + return view("admin::countries.show", compact('data')); } public function edit(Request $request, $id) @@ -113,7 +113,7 @@ class CountriesController extends Controller $TableData = Country::where('status', '<>', -1)->orderBy('display_order')->get(); $data = Country::findOrFail($id); $editable = true; - return view("crud.generated.countries.edit", compact('data', 'TableData', 'editable')); + return view("admin::countries.edit", compact('data', 'TableData', 'editable')); } public function update(Request $request, $id) @@ -187,7 +187,7 @@ class CountriesController extends Controller DB::commit(); return response()->json(['status' => true, 'message' => 'The Country Deleted Successfully.'], 200); } - public function clone (Request $request, $id) + public function clone(Request $request, $id) { // createActivityLog(CountriesController::class, 'clone', ' Country clone'); $data = Country::findOrFail($id); diff --git a/Modules/Admin/app/Http/Controllers/DistrictsController.php b/Modules/Admin/app/Http/Controllers/DistrictsController.php new file mode 100644 index 0000000..45c19c1 --- /dev/null +++ b/Modules/Admin/app/Http/Controllers/DistrictsController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + // createActivityLog(DistrictsController::class, 'index', ' Districts index'); + $data = Districts::where('status', '<>', -1)->orderBy('display_order')->get(); + + return view("admin::districts.index", compact('data')); + } + + public function create(Request $request) + { + // createActivityLog(DistrictsController::class, 'create', ' Districts create'); + $TableData = Districts::where('status', '<>', -1)->orderBy('display_order')->get(); + $editable = false; + return view("admin::districts.edit", compact('TableData', 'editable')); + } + + public function store(Request $request) + { + // createActivityLog(DistrictsController::class, 'store', ' Districts store'); + $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_districts')]); + $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(DistrictsController::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 Districts Created Successfully.'], 200); + } + return redirect()->route('districts.index')->with('success', 'The Districts created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Districts::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 = Districts::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) + { + // createActivityLog(DistrictsController::class, 'show', ' Districts show'); + $data = Districts::findOrFail($id); + + return view("admin::districts.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + // createActivityLog(DistrictsController::class, 'edit', ' Districts edit'); + $TableData = Districts::where('status', '<>', -1)->orderBy('display_order')->get(); + $data = Districts::findOrFail($id); + $editable = true; + return view("admin::districts.edit", compact('data', 'TableData', 'editable')); + } + + + public function update(Request $request, $id) + { + // createActivityLog(DistrictsController::class, 'update', ' Districts update'); + $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('district_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DistrictsController::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 Districts updated Successfully.'], 200); + } + // return redirect()->route('districts.index')->with('success','The Districts updated Successfully.'); + return redirect()->back()->with('success', 'The Districts updated successfully.'); + } + + public function destroy(Request $request, $id) + { + // createActivityLog(DistrictsController::class, 'destroy', ' Districts destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DistrictsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Districts Deleted Successfully.'], 200); + } + public function toggle(Request $request, $id) + { + // createActivityLog(DistrictsController::class, 'destroy', ' Districts destroy'); + $data = Districts::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(DistrictsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Districts Deleted Successfully.'], 200); + } + public function clone(Request $request, $id) + { + // createActivityLog(DistrictsController::class, 'clone', ' Districts clone'); + $data = Districts::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(DistrictsController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Districts Clonned Successfully.'], 200); + } + + + +} diff --git a/Modules/Admin/app/Http/Controllers/GendersController.php b/Modules/Admin/app/Http/Controllers/GendersController.php new file mode 100644 index 0000000..8a6abfb --- /dev/null +++ b/Modules/Admin/app/Http/Controllers/GendersController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + // createActivityLog(GendersController::class, 'index', ' Genders index'); + $data = Genders::where('status', '<>', -1)->orderBy('display_order')->get(); + + return view("admin::genders.index", compact('data')); + } + + public function create(Request $request) + { + // createActivityLog(GendersController::class, 'create', ' Genders create'); + $TableData = Genders::where('status', '<>', -1)->orderBy('display_order')->get(); + $editable = false; + return view("admin::genders.edit", compact('TableData', 'editable')); + } + + public function store(Request $request) + { + // createActivityLog(GendersController::class, 'store', ' Genders store'); + $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_genders')]); + $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(GendersController::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 Genders Created Successfully.'], 200); + } + return redirect()->route('genders.index')->with('success', 'The Genders created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Genders::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 = Genders::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) + { + // createActivityLog(GendersController::class, 'show', ' Genders show'); + $data = Genders::findOrFail($id); + + return view("admin::genders.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + // createActivityLog(GendersController::class, 'edit', ' Genders edit'); + $TableData = Genders::where('status', '<>', -1)->orderBy('display_order')->get(); + $data = Genders::findOrFail($id); + $editable = true; + return view("admin::genders.edit", compact('data', 'TableData', 'editable')); + } + + + public function update(Request $request, $id) + { + // createActivityLog(GendersController::class, 'update', ' Genders update'); + $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('gender_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(GendersController::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 Genders updated Successfully.'], 200); + } + // return redirect()->route('genders.index')->with('success','The Genders updated Successfully.'); + return redirect()->back()->with('success', 'The Genders updated successfully.'); + } + + public function destroy(Request $request, $id) + { + // createActivityLog(GendersController::class, 'destroy', ' Genders destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(GendersController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Genders Deleted Successfully.'], 200); + } + public function toggle(Request $request, $id) + { + // createActivityLog(GendersController::class, 'destroy', ' Genders destroy'); + $data = Genders::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(GendersController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Genders Deleted Successfully.'], 200); + } + public function clone(Request $request, $id) + { + // createActivityLog(GendersController::class, 'clone', ' Genders clone'); + $data = Genders::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(GendersController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Genders Clonned Successfully.'], 200); + } + + + +} diff --git a/Modules/Admin/app/Http/Controllers/NationalitiesController.php b/Modules/Admin/app/Http/Controllers/NationalitiesController.php new file mode 100644 index 0000000..53185e8 --- /dev/null +++ b/Modules/Admin/app/Http/Controllers/NationalitiesController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + // createActivityLog(NationalitiesController::class, 'index', ' Nationalities index'); + $data = Nationalities::where('status', '<>', -1)->orderBy('display_order')->get(); + + return view("admin::nationalities.index", compact('data')); + } + + public function create(Request $request) + { + // createActivityLog(NationalitiesController::class, 'create', ' Nationalities create'); + $TableData = Nationalities::where('status', '<>', -1)->orderBy('display_order')->get(); + $editable = false; + return view("admin::nationalities.edit", compact('TableData', 'editable')); + } + + public function store(Request $request) + { + // createActivityLog(NationalitiesController::class, 'store', ' Nationalities store'); + $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_nationalities')]); + $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(NationalitiesController::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 Nationalities Created Successfully.'], 200); + } + return redirect()->route('nationalities.index')->with('success', 'The Nationalities created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Nationalities::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 = Nationalities::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) + { + // createActivityLog(NationalitiesController::class, 'show', ' Nationalities show'); + $data = Nationalities::findOrFail($id); + + return view("admin::nationalities.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + // createActivityLog(NationalitiesController::class, 'edit', ' Nationalities edit'); + $TableData = Nationalities::where('status', '<>', -1)->orderBy('display_order')->get(); + $data = Nationalities::findOrFail($id); + $editable = true; + return view("admin::nationalities.edit", compact('data', 'TableData', 'editable')); + } + + + public function update(Request $request, $id) + { + // createActivityLog(NationalitiesController::class, 'update', ' Nationalities update'); + $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('nationality_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(NationalitiesController::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 Nationalities updated Successfully.'], 200); + } + // return redirect()->route('nationalities.index')->with('success','The Nationalities updated Successfully.'); + return redirect()->back()->with('success', 'The Nationalities updated successfully.'); + } + + public function destroy(Request $request, $id) + { + // createActivityLog(NationalitiesController::class, 'destroy', ' Nationalities destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(NationalitiesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Nationalities Deleted Successfully.'], 200); + } + public function toggle(Request $request, $id) + { + // createActivityLog(NationalitiesController::class, 'destroy', ' Nationalities destroy'); + $data = Nationalities::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(NationalitiesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Nationalities Deleted Successfully.'], 200); + } + public function clone(Request $request, $id) + { + // createActivityLog(NationalitiesController::class, 'clone', ' Nationalities clone'); + $data = Nationalities::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(NationalitiesController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Nationalities Clonned Successfully.'], 200); + } + + + +} diff --git a/Modules/Admin/app/Http/Controllers/ProvinceController.php b/Modules/Admin/app/Http/Controllers/ProvinceController.php new file mode 100644 index 0000000..4e61b64 --- /dev/null +++ b/Modules/Admin/app/Http/Controllers/ProvinceController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + // createActivityLog(ProvinceController::class, 'index', ' Province index'); + + $data = Province::where('status', '<>', -1)->orderBy('display_order')->get(); + + return view("admin::provinces.index", compact('data')); + } + + public function create(Request $request) + { + // createActivityLog(ProvinceController::class, 'create', ' Province create'); + + $editable = false; + + return view("admin::provinces.edit", compact('editable')); + } + + public function store(Request $request) + { + // createActivityLog(ProvinceController::class, 'store', ' Province store'); + $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_province')]); + $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(ProvinceController::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 Province Created Successfully.'], 200); + } + return redirect()->route('provinces.index')->with('success', 'The Province created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Province::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 = Province::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) + { + // createActivityLog(ProvinceController::class, 'show', ' Province show'); + $data = Province::findOrFail($id); + + return view("admin::provinces.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + // createActivityLog(ProvinceController::class, 'edit', ' Province edit'); + $TableData = Province::where('status', '<>', -1)->orderBy('display_order')->get(); + $data = Province::findOrFail($id); + $editable = true; + return view("admin::provinces.edit", compact('data', 'TableData', 'editable')); + } + + + public function update(Request $request, $id) + { + // createActivityLog(ProvinceController::class, 'update', ' Province update'); + $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('provience_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(ProvinceController::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 Province updated Successfully.'], 200); + } + return redirect()->back()->with('success', 'The Province updated successfully.'); + } + + public function destroy(Request $request, $id) + { + // createActivityLog(ProvinceController::class, 'destroy', ' Province destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(ProvinceController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Province Deleted Successfully.'], 200); + } + public function toggle(Request $request, $id) + { + // createActivityLog(ProvinceController::class, 'destroy', ' Province destroy'); + $data = Province::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(ProvinceController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Province Deleted Successfully.'], 200); + } + public function clone(Request $request, $id) + { + // createActivityLog(ProvinceController::class, 'clone', ' Province clone'); + $data = Province::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(ProvinceController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Province Clonned Successfully.'], 200); + } + +} diff --git a/Modules/Admin/app/Http/Requests/.gitkeep b/Modules/Admin/app/Http/Requests/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Admin/app/Models/.gitkeep b/Modules/Admin/app/Models/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Admin/app/Models/Castes.php b/Modules/Admin/app/Models/Castes.php new file mode 100644 index 0000000..852e581 --- /dev/null +++ b/Modules/Admin/app/Models/Castes.php @@ -0,0 +1,16 @@ +hasMany(Province::class); - } - - public static function getCountries() - { - return self::select('id', 'country_name')->where('status', 'Active')->get(); - } } diff --git a/Modules/Admin/app/Models/Districts.php b/Modules/Admin/app/Models/Districts.php new file mode 100644 index 0000000..59d0837 --- /dev/null +++ b/Modules/Admin/app/Models/Districts.php @@ -0,0 +1,20 @@ +belongsTo(Country::class); + } +} diff --git a/Modules/Admin/app/Providers/.gitkeep b/Modules/Admin/app/Providers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Admin/app/Providers/AdminServiceProvider.php b/Modules/Admin/app/Providers/AdminServiceProvider.php new file mode 100644 index 0000000..79f472b --- /dev/null +++ b/Modules/Admin/app/Providers/AdminServiceProvider.php @@ -0,0 +1,114 @@ +registerCommands(); + $this->registerCommandSchedules(); + $this->registerTranslations(); + $this->registerConfig(); + $this->registerViews(); + $this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations')); + } + + /** + * Register the service provider. + */ + public function register(): void + { + $this->app->register(RouteServiceProvider::class); + } + + /** + * Register commands in the format of Command::class + */ + protected function registerCommands(): void + { + // $this->commands([]); + } + + /** + * Register command Schedules. + */ + protected function registerCommandSchedules(): void + { + // $this->app->booted(function () { + // $schedule = $this->app->make(Schedule::class); + // $schedule->command('inspire')->hourly(); + // }); + } + + /** + * Register translations. + */ + public function registerTranslations(): void + { + $langPath = resource_path('lang/modules/'.$this->moduleNameLower); + + if (is_dir($langPath)) { + $this->loadTranslationsFrom($langPath, $this->moduleNameLower); + $this->loadJsonTranslationsFrom($langPath); + } else { + $this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower); + $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang')); + } + } + + /** + * Register config. + */ + protected function registerConfig(): void + { + $this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config'); + $this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower); + } + + /** + * Register views. + */ + public function registerViews(): void + { + $viewPath = resource_path('views/modules/'.$this->moduleNameLower); + $sourcePath = module_path($this->moduleName, 'resources/views'); + + $this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-views']); + + $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); + + $componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.ltrim(config('modules.paths.generator.component-class.path'), config('modules.paths.app_folder',''))); + Blade::componentNamespace($componentNamespace, $this->moduleNameLower); + } + + /** + * Get the services provided by the provider. + */ + public function provides(): array + { + return []; + } + + private function getPublishableViewPaths(): array + { + $paths = []; + foreach (config('view.paths') as $path) { + if (is_dir($path.'/modules/'.$this->moduleNameLower)) { + $paths[] = $path.'/modules/'.$this->moduleNameLower; + } + } + + return $paths; + } +} diff --git a/Modules/Admin/app/Providers/RouteServiceProvider.php b/Modules/Admin/app/Providers/RouteServiceProvider.php new file mode 100644 index 0000000..61813e6 --- /dev/null +++ b/Modules/Admin/app/Providers/RouteServiceProvider.php @@ -0,0 +1,49 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + */ + protected function mapWebRoutes(): void + { + Route::middleware('web')->group(module_path('Admin', '/routes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + */ + protected function mapApiRoutes(): void + { + Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Admin', '/routes/api.php')); + } +} diff --git a/Modules/Admin/app/Repositories/.gitkeep b/Modules/Admin/app/Repositories/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Admin/app/Services/AdminService.php b/Modules/Admin/app/Services/AdminService.php new file mode 100644 index 0000000..880ab33 --- /dev/null +++ b/Modules/Admin/app/Services/AdminService.php @@ -0,0 +1,51 @@ + 'Admin', +]; diff --git a/Modules/Admin/database/factories/.gitkeep b/Modules/Admin/database/factories/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Admin/database/migrations/.gitkeep b/Modules/Admin/database/migrations/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Admin/database/seeders/.gitkeep b/Modules/Admin/database/seeders/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Admin/database/seeders/AdminDatabaseSeeder.php b/Modules/Admin/database/seeders/AdminDatabaseSeeder.php new file mode 100644 index 0000000..1f761d7 --- /dev/null +++ b/Modules/Admin/database/seeders/AdminDatabaseSeeder.php @@ -0,0 +1,16 @@ +call([]); + } +} diff --git a/Modules/Admin/module.json b/Modules/Admin/module.json new file mode 100644 index 0000000..b8e93da --- /dev/null +++ b/Modules/Admin/module.json @@ -0,0 +1,11 @@ +{ + "name": "Admin", + "alias": "admin", + "description": "", + "keywords": [], + "priority": 0, + "providers": [ + "Modules\\Admin\\Providers\\AdminServiceProvider" + ], + "files": [] +} diff --git a/Modules/Admin/package.json b/Modules/Admin/package.json new file mode 100644 index 0000000..d6fbfc8 --- /dev/null +++ b/Modules/Admin/package.json @@ -0,0 +1,15 @@ +{ + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build" + }, + "devDependencies": { + "axios": "^1.1.2", + "laravel-vite-plugin": "^0.7.5", + "sass": "^1.69.5", + "postcss": "^8.3.7", + "vite": "^4.0.0" + } +} diff --git a/Modules/Admin/resources/assets/.gitkeep b/Modules/Admin/resources/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Admin/resources/assets/js/app.js b/Modules/Admin/resources/assets/js/app.js new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Admin/resources/assets/sass/app.scss b/Modules/Admin/resources/assets/sass/app.scss new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Admin/resources/views/.gitkeep b/Modules/Admin/resources/views/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Admin/resources/views/castes/edit.blade.php b/Modules/Admin/resources/views/castes/edit.blade.php new file mode 100644 index 0000000..dd424b8 --- /dev/null +++ b/Modules/Admin/resources/views/castes/edit.blade.php @@ -0,0 +1,41 @@ +@extends('layouts.app') +@section('content') +
{{ label('Sn.') }} | -{{ label('title') }} | -{{ label('alias') }} | -{{ label('Action') }} - | -
---|---|---|---|
{{ $i++ }} | -{{ $item->title }} | -
-
- {{ $item->alias }}
-
-
- change alias
- |
-
-
-
- |
-
{{ label('Sn.') }} | +{{ label('title') }} | +{{ label('alias') }} | +{{ label('Action') }} + | +
---|---|---|---|
{{ $index + 1 }} | +{{ $item->title }} | +
+
+ {{ $item->alias }}
+
+
+ change alias
+ |
+
+
+
+
+
+ |
+
Title : {{ $data->title }}
+Alias : {{ $data->alias }}
+Description : {{ $data->description }}
+Display Order : {{ $data->display_order }}
+Status : {{ $data->status == 1 ? 'Active' : 'Inactive' }} +
+Remarks : {{ $data->remarks }}
+Createdby : {{ $data->createdby }}
+Updatedby : {{ $data->updatedby }}
+Created On : {{ $data->created_at }}
+Created By : {{ $data->createdBy }}
+Updated On : {{ $data->updated_at }}
+Updated By : {{ $data->updatedBy }}
+ +