From f4718d7d55b18cdfefee9dbce6bc3b3c318ec66e Mon Sep 17 00:00:00 2001 From: Ranjan Date: Fri, 5 Apr 2024 10:16:48 +0545 Subject: [PATCH] remove leave module --- Modules/Leave/app/Http/Controllers/.gitkeep | 0 .../app/Http/Controllers/LeaveController.php | 84 ------------- Modules/Leave/app/Http/Requests/.gitkeep | 0 Modules/Leave/app/Models/.gitkeep | 0 Modules/Leave/app/Models/Leave.php | 12 -- Modules/Leave/app/Providers/.gitkeep | 0 .../app/Providers/LeaveServiceProvider.php | 118 ------------------ .../app/Providers/RouteServiceProvider.php | 49 -------- Modules/Leave/app/Repositories/.gitkeep | 0 .../Leave/app/Repositories/LeaveInterface.php | 12 -- .../app/Repositories/LeaveRepository.php | 34 ----- Modules/Leave/database/factories/.gitkeep | 0 .../Leave/resources/views/create.blade.php | 44 ------- .../resources/views/partials/action.blade.php | 27 ---- 14 files changed, 380 deletions(-) delete mode 100644 Modules/Leave/app/Http/Controllers/.gitkeep delete mode 100644 Modules/Leave/app/Http/Controllers/LeaveController.php delete mode 100644 Modules/Leave/app/Http/Requests/.gitkeep delete mode 100644 Modules/Leave/app/Models/.gitkeep delete mode 100644 Modules/Leave/app/Models/Leave.php delete mode 100644 Modules/Leave/app/Providers/.gitkeep delete mode 100644 Modules/Leave/app/Providers/LeaveServiceProvider.php delete mode 100644 Modules/Leave/app/Providers/RouteServiceProvider.php delete mode 100644 Modules/Leave/app/Repositories/.gitkeep delete mode 100644 Modules/Leave/app/Repositories/LeaveInterface.php delete mode 100644 Modules/Leave/app/Repositories/LeaveRepository.php delete mode 100644 Modules/Leave/database/factories/.gitkeep delete mode 100644 Modules/Leave/resources/views/create.blade.php delete mode 100644 Modules/Leave/resources/views/partials/action.blade.php diff --git a/Modules/Leave/app/Http/Controllers/.gitkeep b/Modules/Leave/app/Http/Controllers/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Modules/Leave/app/Http/Controllers/LeaveController.php b/Modules/Leave/app/Http/Controllers/LeaveController.php deleted file mode 100644 index 7f65e29..0000000 --- a/Modules/Leave/app/Http/Controllers/LeaveController.php +++ /dev/null @@ -1,84 +0,0 @@ -leaveRepository = $leaveRepository; - } - - /** - * Display a listing of the resource. - */ - public function index() - { - $data['leaves'] = $this->leaveRepository->findAll(); - // dd($data['leaves']); - return view('leave::index'); - } - - /** - * Show the form for creating a new resource. - */ - public function create() - { - $data['title'] = 'Create Leave'; - return view('leave::create', $data); - } - - /** - * Store a newly created resource in storage. - */ - public function store(Request $request): RedirectResponse - { - $inputData = $request->all(); - try { - $this->leaveRepository->create($inputData); - toastr()->success('Leave Created Succesfully'); - } catch (\Throwable $th) { - toastr()->error($th->getMessage()); - } - return redirect()->route('leave.index'); - } - - /** - * Show the specified resource. - */ - public function show($id) - { - return view('leave::show'); - } - - /** - * Show the form for editing the specified resource. - */ - public function edit($id) - { - return view('leave::edit'); - } - - /** - * Update the specified resource in storage. - */ - public function update(Request $request, $id): RedirectResponse - { - // - } - - /** - * Remove the specified resource from storage. - */ - public function destroy($id) - { - // - } -} diff --git a/Modules/Leave/app/Http/Requests/.gitkeep b/Modules/Leave/app/Http/Requests/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Modules/Leave/app/Models/.gitkeep b/Modules/Leave/app/Models/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Modules/Leave/app/Models/Leave.php b/Modules/Leave/app/Models/Leave.php deleted file mode 100644 index 48f2185..0000000 --- a/Modules/Leave/app/Models/Leave.php +++ /dev/null @@ -1,12 +0,0 @@ -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->bind(LeaveInterface::class, LeaveRepository::class); - $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/Leave/app/Providers/RouteServiceProvider.php b/Modules/Leave/app/Providers/RouteServiceProvider.php deleted file mode 100644 index 29b900e..0000000 --- a/Modules/Leave/app/Providers/RouteServiceProvider.php +++ /dev/null @@ -1,49 +0,0 @@ -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('Leave', '/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('Leave', '/routes/api.php')); - } -} diff --git a/Modules/Leave/app/Repositories/.gitkeep b/Modules/Leave/app/Repositories/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Modules/Leave/app/Repositories/LeaveInterface.php b/Modules/Leave/app/Repositories/LeaveInterface.php deleted file mode 100644 index d34795e..0000000 --- a/Modules/Leave/app/Repositories/LeaveInterface.php +++ /dev/null @@ -1,12 +0,0 @@ -update($newDetails); - } - -} diff --git a/Modules/Leave/database/factories/.gitkeep b/Modules/Leave/database/factories/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Modules/Leave/resources/views/create.blade.php b/Modules/Leave/resources/views/create.blade.php deleted file mode 100644 index 22a97da..0000000 --- a/Modules/Leave/resources/views/create.blade.php +++ /dev/null @@ -1,44 +0,0 @@ -@extends('layouts.app') - -@section('content') -
-
- -
-
-
-

{{ $title }}

- -
- -
- -
-
-
- -
-
-
-
-
- @csrf - @include('leave::partials.action') -
-
-
-
-
- - -
- -
-@endsection - -@push('js') - -@endpush diff --git a/Modules/Leave/resources/views/partials/action.blade.php b/Modules/Leave/resources/views/partials/action.blade.php deleted file mode 100644 index bae23c3..0000000 --- a/Modules/Leave/resources/views/partials/action.blade.php +++ /dev/null @@ -1,27 +0,0 @@ -
- - -
- Please enter Employee Name. -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- -