diff --git a/Modules/Taxation/app/Http/Controllers/.gitkeep b/Modules/Taxation/app/Http/Controllers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Taxation/app/Http/Controllers/TaxationController.php b/Modules/Taxation/app/Http/Controllers/TaxationController.php new file mode 100644 index 0000000..41053bf --- /dev/null +++ b/Modules/Taxation/app/Http/Controllers/TaxationController.php @@ -0,0 +1,67 @@ +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('Taxation', '/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('Taxation', '/routes/api.php')); + } +} diff --git a/Modules/Taxation/app/Providers/TaxationServiceProvider.php b/Modules/Taxation/app/Providers/TaxationServiceProvider.php new file mode 100644 index 0000000..f5c3b31 --- /dev/null +++ b/Modules/Taxation/app/Providers/TaxationServiceProvider.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/Taxation/app/Repositories/.gitkeep b/Modules/Taxation/app/Repositories/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Taxation/app/Repositories/EmployeeInterface.php b/Modules/Taxation/app/Repositories/EmployeeInterface.php new file mode 100644 index 0000000..4f80cb3 --- /dev/null +++ b/Modules/Taxation/app/Repositories/EmployeeInterface.php @@ -0,0 +1,15 @@ +first(); + } + + public function delete($employeeId) + { + Employee::destroy($employeeId); + } + + public function create($employeeDetails) + { + return Employee::create($employeeDetails); + } + + public function update($employeeId, array $newDetails) + { + return Employee::whereId($employeeId)->update($newDetails); + } + + public function pluck() + { + return Employee::pluck('first_name', 'id'); + } + + // public function uploadImage($file) + // { + // if ($req->file()) { + // $fileName = time() . '_' . $req->file->getClientOriginalName(); + // $filePath = $req->file('file')->storeAs('uploads', $fileName, 'public'); + // $fileModel->name = time() . '_' . $req->file->getClientOriginalName(); + // $fileModel->file_path = '/storage/' . $filePath; + // $fileModel->save(); + // return back() + // ->with('success', 'File has been uploaded.') + // ->with('file', $fileName); + // } + // } + +} diff --git a/Modules/Taxation/composer.json b/Modules/Taxation/composer.json new file mode 100644 index 0000000..eacdc33 --- /dev/null +++ b/Modules/Taxation/composer.json @@ -0,0 +1,30 @@ +{ + "name": "nwidart/taxation", + "description": "", + "authors": [ + { + "name": "Nicolas Widart", + "email": "n.widart@gmail.com" + } + ], + "extra": { + "laravel": { + "providers": [], + "aliases": { + + } + } + }, + "autoload": { + "psr-4": { + "Modules\\Taxation\\": "app/", + "Modules\\Taxation\\Database\\Factories\\": "database/factories/", + "Modules\\Taxation\\Database\\Seeders\\": "database/seeders/" + } + }, + "autoload-dev": { + "psr-4": { + "Modules\\Taxation\\Tests\\": "tests/" + } + } +} diff --git a/Modules/Taxation/config/.gitkeep b/Modules/Taxation/config/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Taxation/config/config.php b/Modules/Taxation/config/config.php new file mode 100644 index 0000000..a7b5dc4 --- /dev/null +++ b/Modules/Taxation/config/config.php @@ -0,0 +1,5 @@ + 'Taxation', +]; diff --git a/Modules/Taxation/database/factories/.gitkeep b/Modules/Taxation/database/factories/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Taxation/database/migrations/.gitkeep b/Modules/Taxation/database/migrations/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Taxation/database/seeders/.gitkeep b/Modules/Taxation/database/seeders/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Taxation/database/seeders/TaxationDatabaseSeeder.php b/Modules/Taxation/database/seeders/TaxationDatabaseSeeder.php new file mode 100644 index 0000000..3e12b19 --- /dev/null +++ b/Modules/Taxation/database/seeders/TaxationDatabaseSeeder.php @@ -0,0 +1,16 @@ +call([]); + } +} diff --git a/Modules/Taxation/module.json b/Modules/Taxation/module.json new file mode 100644 index 0000000..7a2e930 --- /dev/null +++ b/Modules/Taxation/module.json @@ -0,0 +1,11 @@ +{ + "name": "Taxation", + "alias": "taxation", + "description": "", + "keywords": [], + "priority": 0, + "providers": [ + "Modules\\Taxation\\Providers\\TaxationServiceProvider" + ], + "files": [] +} diff --git a/Modules/Taxation/package.json b/Modules/Taxation/package.json new file mode 100644 index 0000000..d6fbfc8 --- /dev/null +++ b/Modules/Taxation/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/Taxation/resources/assets/.gitkeep b/Modules/Taxation/resources/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Taxation/resources/assets/js/app.js b/Modules/Taxation/resources/assets/js/app.js new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Taxation/resources/assets/sass/app.scss b/Modules/Taxation/resources/assets/sass/app.scss new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Taxation/resources/views/.gitkeep b/Modules/Taxation/resources/views/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Modules/Taxation/resources/views/layouts/master.blade.php b/Modules/Taxation/resources/views/layouts/master.blade.php new file mode 100644 index 0000000..c2eecc3 --- /dev/null +++ b/Modules/Taxation/resources/views/layouts/master.blade.php @@ -0,0 +1,29 @@ + + + +
+ + + + + +S.N | +Leave Type | +Created By | +Status | +Action | +|
---|---|---|---|---|---|
{{ $key + 1 }} | +{{ $leaveType->employee_id }} | +{{ $leaveType->start_date }} | +{{ $leaveType->end_date }} | +{{ $leaveType->created_at }} | ++ + | +