diff --git a/Modules/Leave/Http/Controllers/.gitkeep b/Modules/Leave/Http/Controllers/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Modules/Leave/Http/Controllers/LeaveController.php b/Modules/Leave/Http/Controllers/LeaveController.php deleted file mode 100644 index 7f65e29..0000000 --- a/Modules/Leave/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/Models/.gitkeep b/Modules/Leave/Models/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Modules/Leave/Models/Leave.php b/Modules/Leave/Models/Leave.php deleted file mode 100644 index 0739923..0000000 --- a/Modules/Leave/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/Providers/RouteServiceProvider.php b/Modules/Leave/Providers/RouteServiceProvider.php deleted file mode 100644 index 29b900e..0000000 --- a/Modules/Leave/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/Repositories/.gitkeep b/Modules/Leave/Repositories/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Modules/Leave/Repositories/LeaveInterface.php b/Modules/Leave/Repositories/LeaveInterface.php deleted file mode 100644 index d34795e..0000000 --- a/Modules/Leave/Repositories/LeaveInterface.php +++ /dev/null @@ -1,12 +0,0 @@ -update($newDetails); - } - -} diff --git a/Modules/Leave/composer.json b/Modules/Leave/composer.json deleted file mode 100644 index c2a47e6..0000000 --- a/Modules/Leave/composer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "nwidart/leave", - "description": "", - "authors": [ - { - "name": "Nicolas Widart", - "email": "n.widart@gmail.com" - } - ], - "extra": { - "laravel": { - "providers": [], - "aliases": { - - } - } - }, - "autoload": { - "psr-4": { - "Modules\\Leave\\": "app/", - "Modules\\Leave\\Database\\Factories\\": "database/factories/", - "Modules\\Leave\\Database\\Seeders\\": "database/seeders/" - } - }, - "autoload-dev": { - "psr-4": { - "Modules\\Leave\\Tests\\": "tests/" - } - } -} diff --git a/Modules/Leave/config/.gitkeep b/Modules/Leave/config/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Modules/Leave/config/config.php b/Modules/Leave/config/config.php deleted file mode 100644 index 827548c..0000000 --- a/Modules/Leave/config/config.php +++ /dev/null @@ -1,5 +0,0 @@ - 'Leave', -]; diff --git a/Modules/Leave/database/migrations/.gitkeep b/Modules/Leave/database/migrations/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Modules/Leave/database/migrations/2024_04_04_102430_create_leaves_table.php b/Modules/Leave/database/migrations/2024_04_04_102430_create_leaves_table.php deleted file mode 100644 index 0accbdc..0000000 --- a/Modules/Leave/database/migrations/2024_04_04_102430_create_leaves_table.php +++ /dev/null @@ -1,30 +0,0 @@ -tinyInteger('leave_id')->unsigned()->autoIncrement(); - $table->integer('employee_id'); - $table->date('start_date'); - $table->date('end_date'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('leaves'); - } -}; diff --git a/Modules/Leave/database/seeders/.gitkeep b/Modules/Leave/database/seeders/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Modules/Leave/database/seeders/LeaveDatabaseSeeder.php b/Modules/Leave/database/seeders/LeaveDatabaseSeeder.php deleted file mode 100644 index 0a3661a..0000000 --- a/Modules/Leave/database/seeders/LeaveDatabaseSeeder.php +++ /dev/null @@ -1,16 +0,0 @@ -call([]); - } -} diff --git a/Modules/Leave/module.json b/Modules/Leave/module.json deleted file mode 100644 index c81af7a..0000000 --- a/Modules/Leave/module.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "Leave", - "alias": "leave", - "description": "", - "keywords": [], - "priority": 0, - "providers": [ - "Modules\\Leave\\Providers\\LeaveServiceProvider" - ], - "files": [] -} diff --git a/Modules/Leave/package.json b/Modules/Leave/package.json deleted file mode 100644 index d6fbfc8..0000000 --- a/Modules/Leave/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "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/Leave/resources/assets/.gitkeep b/Modules/Leave/resources/assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Modules/Leave/resources/assets/js/app.js b/Modules/Leave/resources/assets/js/app.js deleted file mode 100644 index e69de29..0000000 diff --git a/Modules/Leave/resources/assets/sass/app.scss b/Modules/Leave/resources/assets/sass/app.scss deleted file mode 100644 index e69de29..0000000 diff --git a/Modules/Leave/resources/views/.gitkeep b/Modules/Leave/resources/views/.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 c56be23..0000000 --- a/Modules/Leave/resources/views/create.blade.php +++ /dev/null @@ -1,40 +0,0 @@ -@extends('layouts.app') - -@section('content') -
Name | -Position | -Office | -Age | -Start date | -Salary | -
---|---|---|---|---|---|
Tiger Nixon | -System Architect | -Edinburgh | -61 | -2011/04/25 | -$320,800 | -
Garrett Winters | -Accountant | -Tokyo | -63 | -2011/07/25 | -$170,750 | -
Ashton Cox | -Junior Technical Author | -San Francisco | -66 | -2009/01/12 | -$86,000 | -
Cedric Kelly | -Senior Javascript Developer | -Edinburgh | -22 | -2012/03/29 | -$433,060 | -
Airi Satou | -Accountant | -Tokyo | -33 | -2008/11/28 | -$162,700 | -
Brielle Williamson | -Integration Specialist | -New York | -61 | -2012/12/02 | -$372,000 | -
Herrod Chandler | -Sales Assistant | -San Francisco | -59 | -2012/08/06 | -$137,500 | -
Rhona Davidson | -Integration Specialist | -Tokyo | -55 | -2010/10/14 | -$327,900 | -
Colleen Hurst | -Javascript Developer | -San Francisco | -39 | -2009/09/15 | -$205,500 | -
Sonya Frost | -Software Engineer | -Edinburgh | -23 | -2008/12/13 | -$103,600 | -
Jena Gaines | -Office Manager | -London | -30 | -2008/12/19 | -$90,560 | -
Quinn Flynn | -Support Lead | -Edinburgh | -22 | -2013/03/03 | -$342,000 | -
Charde Marshall | -Regional Director | -San Francisco | -36 | -2008/10/16 | -$470,600 | -
Haley Kennedy | -Senior Marketing Designer | -London | -43 | -2012/12/18 | -$313,500 | -
Tatyana Fitzpatrick | -Regional Director | -London | -19 | -2010/03/17 | -$385,750 | -
Michael Silva | -Marketing Designer | -London | -66 | -2012/11/27 | -$198,500 | -
Paul Byrd | -Chief Financial Officer (CFO) | -New York | -64 | -2010/06/09 | -$725,000 | -
Gloria Little | -Systems Administrator | -New York | -59 | -2009/04/10 | -$237,500 | -
Bradley Greer | -Software Engineer | -London | -41 | -2012/10/13 | -$132,000 | -
Dai Rios | -Personnel Lead | -Edinburgh | -35 | -2012/09/26 | -$217,500 | -
Jenette Caldwell | -Development Lead | -New York | -30 | -2011/09/03 | -$345,000 | -
Yuri Berry | -Chief Marketing Officer (CMO) | -New York | -40 | -2009/06/25 | -$675,000 | -
Caesar Vance | -Pre-Sales Support | -New York | -21 | -2011/12/12 | -$106,450 | -
Doris Wilder | -Sales Assistant | -Sydney | -23 | -2010/09/20 | -$85,600 | -
Gavin Cortez | -Team Leader | -San Francisco | -22 | -2008/10/26 | -$235,500 | -
Martena Mccray | -Post-Sales support | -Edinburgh | -46 | -2011/03/09 | -$324,050 | -
Unity Butler | -Marketing Designer | -San Francisco | -47 | -2009/12/09 | -$85,675 | -