diff --git a/.htaccess b/.htaccess
new file mode 100644
index 0000000..7735dd1
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,18 @@
+
+
+ Options -MultiViews
+
+
+ RewriteEngine On
+
+ RewriteCond %{REQUEST_FILENAME} -d [OR]
+ RewriteCond %{REQUEST_FILENAME} -f
+ RewriteRule ^ ^$1 [N]
+
+ RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
+ RewriteRule ^(.*)$ public/$1
+
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteRule ^ server.php
+
\ No newline at end of file
diff --git a/Modules/Attendance/app/Http/Controllers/.gitkeep b/Modules/Attendance/app/Http/Controllers/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/Attendance/app/Http/Controllers/AttendanceController.php b/Modules/Attendance/app/Http/Controllers/AttendanceController.php
new file mode 100644
index 0000000..787a2b0
--- /dev/null
+++ b/Modules/Attendance/app/Http/Controllers/AttendanceController.php
@@ -0,0 +1,67 @@
+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/Attendance/app/Providers/RouteServiceProvider.php b/Modules/Attendance/app/Providers/RouteServiceProvider.php
new file mode 100644
index 0000000..6a6cc87
--- /dev/null
+++ b/Modules/Attendance/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('Attendance', '/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('Attendance', '/routes/api.php'));
+ }
+}
diff --git a/Modules/Attendance/app/Repositories/.gitkeep b/Modules/Attendance/app/Repositories/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/Attendance/composer.json b/Modules/Attendance/composer.json
new file mode 100644
index 0000000..8556d91
--- /dev/null
+++ b/Modules/Attendance/composer.json
@@ -0,0 +1,30 @@
+{
+ "name": "nwidart/attendance",
+ "description": "",
+ "authors": [
+ {
+ "name": "Nicolas Widart",
+ "email": "n.widart@gmail.com"
+ }
+ ],
+ "extra": {
+ "laravel": {
+ "providers": [],
+ "aliases": {
+
+ }
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Modules\\Attendance\\": "app/",
+ "Modules\\Attendance\\Database\\Factories\\": "database/factories/",
+ "Modules\\Attendance\\Database\\Seeders\\": "database/seeders/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Modules\\Attendance\\Tests\\": "tests/"
+ }
+ }
+}
diff --git a/Modules/Attendance/config/.gitkeep b/Modules/Attendance/config/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/Attendance/config/config.php b/Modules/Attendance/config/config.php
new file mode 100644
index 0000000..080df77
--- /dev/null
+++ b/Modules/Attendance/config/config.php
@@ -0,0 +1,5 @@
+ 'Attendance',
+];
diff --git a/Modules/Attendance/database/factories/.gitkeep b/Modules/Attendance/database/factories/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/Attendance/database/migrations/.gitkeep b/Modules/Attendance/database/migrations/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/Attendance/database/seeders/.gitkeep b/Modules/Attendance/database/seeders/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/Attendance/database/seeders/AttendanceDatabaseSeeder.php b/Modules/Attendance/database/seeders/AttendanceDatabaseSeeder.php
new file mode 100644
index 0000000..2f8f306
--- /dev/null
+++ b/Modules/Attendance/database/seeders/AttendanceDatabaseSeeder.php
@@ -0,0 +1,16 @@
+call([]);
+ }
+}
diff --git a/Modules/Attendance/module.json b/Modules/Attendance/module.json
new file mode 100644
index 0000000..bfa3a17
--- /dev/null
+++ b/Modules/Attendance/module.json
@@ -0,0 +1,11 @@
+{
+ "name": "Attendance",
+ "alias": "attendance",
+ "description": "",
+ "keywords": [],
+ "priority": 0,
+ "providers": [
+ "Modules\\Attendance\\Providers\\AttendanceServiceProvider"
+ ],
+ "files": []
+}
diff --git a/Modules/Attendance/package.json b/Modules/Attendance/package.json
new file mode 100644
index 0000000..d6fbfc8
--- /dev/null
+++ b/Modules/Attendance/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/Attendance/resources/assets/.gitkeep b/Modules/Attendance/resources/assets/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/Attendance/resources/assets/js/app.js b/Modules/Attendance/resources/assets/js/app.js
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/Attendance/resources/assets/sass/app.scss b/Modules/Attendance/resources/assets/sass/app.scss
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/Attendance/resources/views/.gitkeep b/Modules/Attendance/resources/views/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/Attendance/resources/views/index.blade.php b/Modules/Attendance/resources/views/index.blade.php
new file mode 100644
index 0000000..7b1a268
--- /dev/null
+++ b/Modules/Attendance/resources/views/index.blade.php
@@ -0,0 +1,7 @@
+@extends('attendance::layouts.master')
+
+@section('content')
+
Hello World
+
+ Module: {!! config('attendance.name') !!}
+@endsection
diff --git a/Modules/Attendance/resources/views/layouts/master.blade.php b/Modules/Attendance/resources/views/layouts/master.blade.php
new file mode 100644
index 0000000..62332e4
--- /dev/null
+++ b/Modules/Attendance/resources/views/layouts/master.blade.php
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+ Attendance Module - {{ config('app.name', 'Laravel') }}
+
+
+
+
+
+
+
+
+
+ {{-- Vite CSS --}}
+ {{-- {{ module_vite('build-attendance', 'resources/assets/sass/app.scss') }} --}}
+
+
+
+ @yield('content')
+
+ {{-- Vite JS --}}
+ {{-- {{ module_vite('build-attendance', 'resources/assets/js/app.js') }} --}}
+
diff --git a/Modules/Attendance/routes/.gitkeep b/Modules/Attendance/routes/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/Attendance/routes/api.php b/Modules/Attendance/routes/api.php
new file mode 100644
index 0000000..e349118
--- /dev/null
+++ b/Modules/Attendance/routes/api.php
@@ -0,0 +1,19 @@
+prefix('v1')->group(function () {
+ Route::apiResource('attendance', AttendanceController::class)->names('attendance');
+});
diff --git a/Modules/Attendance/routes/web.php b/Modules/Attendance/routes/web.php
new file mode 100644
index 0000000..3e0eaad
--- /dev/null
+++ b/Modules/Attendance/routes/web.php
@@ -0,0 +1,19 @@
+names('attendance');
+});
diff --git a/Modules/Attendance/vite.config.js b/Modules/Attendance/vite.config.js
new file mode 100644
index 0000000..ae729ea
--- /dev/null
+++ b/Modules/Attendance/vite.config.js
@@ -0,0 +1,26 @@
+import { defineConfig } from 'vite';
+import laravel from 'laravel-vite-plugin';
+
+export default defineConfig({
+ build: {
+ outDir: '../../public/build-attendance',
+ emptyOutDir: true,
+ manifest: true,
+ },
+ plugins: [
+ laravel({
+ publicDirectory: '../../public',
+ buildDirectory: 'build-attendance',
+ input: [
+ __dirname + '/resources/assets/sass/app.scss',
+ __dirname + '/resources/assets/js/app.js'
+ ],
+ refresh: true,
+ }),
+ ],
+});
+
+//export const paths = [
+// 'Modules/Attendance/resources/assets/sass/app.scss',
+// 'Modules/Attendance/resources/assets/js/app.js',
+//];
\ No newline at end of file
diff --git a/Modules/Employee/app/Http/Requests/.gitkeep b/Modules/Employee/app/Http/Requests/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/Employee/app/Models/Employee.php b/Modules/Employee/app/Models/Employee.php
deleted file mode 100644
index 7002cf2..0000000
--- a/Modules/Employee/app/Models/Employee.php
+++ /dev/null
@@ -1,13 +0,0 @@
-app->bind(EmployeeInterface::class, EmployeeRepository::class);
$this->app->register(RouteServiceProvider::class);
}
diff --git a/Modules/Employee/app/Repositories/EmployeeInterface.php b/Modules/Employee/app/Repositories/EmployeeInterface.php
deleted file mode 100644
index 947e916..0000000
--- a/Modules/Employee/app/Repositories/EmployeeInterface.php
+++ /dev/null
@@ -1,12 +0,0 @@
-update($newDetails);
- }
-
-}
diff --git a/Modules/Employee/database/factories/.gitkeep b/Modules/Employee/database/factories/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/Employee/resources/views/index.blade.php b/Modules/Employee/resources/views/index.blade.php
index 8031d3b..d4ef68a 100644
--- a/Modules/Employee/resources/views/index.blade.php
+++ b/Modules/Employee/resources/views/index.blade.php
@@ -5,21 +5,8 @@
-
-
-
-
Team
+ @include('layouts.partials.breadcrumb', ['title' => 'Employee'])
-
-
-
-
-
@@ -37,7 +24,7 @@
+ data-bs-target="#addmemberModal"> Create Employee
@@ -53,6 +40,7 @@
+
@@ -112,6 +100,7 @@
+
@@ -172,6 +161,7 @@
+
-
-
-
-
Sorry! No Result Found
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Nancy Martino
-
Team Leader & HR
-
-
-
-
-
-
-
Personal Details
-
-
Number
-
+(256) 2451 8974
-
-
-
Email
-
nancymartino@email.com
-
-
-
Location
-
Carson City - USA
-
-
-
-
-
-
-
-
View Profile
-
-
-
diff --git a/Modules/Leave/resources/views/create.blade.php b/Modules/Leave/resources/views/create.blade.php
index 92dd147..b757afb 100644
--- a/Modules/Leave/resources/views/create.blade.php
+++ b/Modules/Leave/resources/views/create.blade.php
@@ -4,21 +4,7 @@
-
-
-
-
{{ $title }}
-
-
-
- - Dashboards
- - {{ $title }}
-
-
-
-
-
-
+ @include('layouts.partials.breadcrumb', ['title' => $title])
diff --git a/Modules/Leave/resources/views/index.blade.php b/Modules/Leave/resources/views/index.blade.php
index 0aab2c4..d15471d 100644
--- a/Modules/Leave/resources/views/index.blade.php
+++ b/Modules/Leave/resources/views/index.blade.php
@@ -84,8 +84,9 @@
-
+
@@ -98,48 +99,10 @@
-
+
+
-
+
@include('leave::partials.view')
@endsection
-
-@push('js')
-
-@endpush
diff --git a/Modules/User/app/Http/Controllers/.gitkeep b/Modules/User/app/Http/Controllers/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/User/app/Http/Controllers/UserController.php b/Modules/User/app/Http/Controllers/UserController.php
new file mode 100644
index 0000000..8d68047
--- /dev/null
+++ b/Modules/User/app/Http/Controllers/UserController.php
@@ -0,0 +1,72 @@
+get();
+ $editable = false;
+ return view('user::index', compact('data', 'editable'));
+ }
+
+ /**
+ * Show the form for creating a new resource.
+ */
+ public function create()
+ {
+ $data['title'] = "Create User";
+ return view('user::create', $data);
+ }
+
+ /**
+ * Store a newly created resource in storage.
+ */
+ public function store(Request $request): RedirectResponse
+ {
+ //
+ }
+
+ /**
+ * Show the specified resource.
+ */
+ public function show($id)
+ {
+ return view('user::show');
+ }
+
+ /**
+ * Show the form for editing the specified resource.
+ */
+ public function edit($id)
+ {
+ $data['title'] = "Edit User";
+ $data['user'] = User::findOrFail($id);
+ return view('user::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)
+ {
+ //
+ }
+}
diff --git a/Modules/User/app/Http/Requests/.gitkeep b/Modules/User/app/Http/Requests/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/User/app/Models/.gitkeep b/Modules/User/app/Models/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/User/app/Providers/.gitkeep b/Modules/User/app/Providers/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/User/app/Providers/RouteServiceProvider.php b/Modules/User/app/Providers/RouteServiceProvider.php
new file mode 100644
index 0000000..9ae8055
--- /dev/null
+++ b/Modules/User/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('User', '/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('User', '/routes/api.php'));
+ }
+}
diff --git a/Modules/User/app/Providers/UserServiceProvider.php b/Modules/User/app/Providers/UserServiceProvider.php
new file mode 100644
index 0000000..a694b09
--- /dev/null
+++ b/Modules/User/app/Providers/UserServiceProvider.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/User/app/Repositories/.gitkeep b/Modules/User/app/Repositories/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/User/composer.json b/Modules/User/composer.json
new file mode 100644
index 0000000..6a22c82
--- /dev/null
+++ b/Modules/User/composer.json
@@ -0,0 +1,30 @@
+{
+ "name": "nwidart/user",
+ "description": "",
+ "authors": [
+ {
+ "name": "Nicolas Widart",
+ "email": "n.widart@gmail.com"
+ }
+ ],
+ "extra": {
+ "laravel": {
+ "providers": [],
+ "aliases": {
+
+ }
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Modules\\User\\": "app/",
+ "Modules\\User\\Database\\Factories\\": "database/factories/",
+ "Modules\\User\\Database\\Seeders\\": "database/seeders/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Modules\\User\\Tests\\": "tests/"
+ }
+ }
+}
diff --git a/Modules/User/config/.gitkeep b/Modules/User/config/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/User/config/config.php b/Modules/User/config/config.php
new file mode 100644
index 0000000..566de5a
--- /dev/null
+++ b/Modules/User/config/config.php
@@ -0,0 +1,5 @@
+ 'User',
+];
diff --git a/Modules/User/database/factories/.gitkeep b/Modules/User/database/factories/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/User/database/migrations/.gitkeep b/Modules/User/database/migrations/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/User/database/seeders/.gitkeep b/Modules/User/database/seeders/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/User/database/seeders/UserDatabaseSeeder.php b/Modules/User/database/seeders/UserDatabaseSeeder.php
new file mode 100644
index 0000000..9983acc
--- /dev/null
+++ b/Modules/User/database/seeders/UserDatabaseSeeder.php
@@ -0,0 +1,16 @@
+call([]);
+ }
+}
diff --git a/Modules/User/module.json b/Modules/User/module.json
new file mode 100644
index 0000000..09e540d
--- /dev/null
+++ b/Modules/User/module.json
@@ -0,0 +1,11 @@
+{
+ "name": "User",
+ "alias": "user",
+ "description": "",
+ "keywords": [],
+ "priority": 0,
+ "providers": [
+ "Modules\\User\\Providers\\UserServiceProvider"
+ ],
+ "files": []
+}
diff --git a/Modules/User/package.json b/Modules/User/package.json
new file mode 100644
index 0000000..d6fbfc8
--- /dev/null
+++ b/Modules/User/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/User/resources/assets/.gitkeep b/Modules/User/resources/assets/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/User/resources/assets/js/app.js b/Modules/User/resources/assets/js/app.js
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/User/resources/assets/sass/app.scss b/Modules/User/resources/assets/sass/app.scss
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/User/resources/views/.gitkeep b/Modules/User/resources/views/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/User/resources/views/create.blade.php b/Modules/User/resources/views/create.blade.php
new file mode 100644
index 0000000..166da0d
--- /dev/null
+++ b/Modules/User/resources/views/create.blade.php
@@ -0,0 +1,44 @@
+@extends('layouts.app')
+
+@section('content')
+
+
+
+
+
+
+
{{ $title }}
+
+
+
+ - Dashboards
+ - {{ $title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+@endsection
+
+@push('js')
+
+@endpush
diff --git a/Modules/User/resources/views/edit.blade.php b/Modules/User/resources/views/edit.blade.php
new file mode 100644
index 0000000..166da0d
--- /dev/null
+++ b/Modules/User/resources/views/edit.blade.php
@@ -0,0 +1,44 @@
+@extends('layouts.app')
+
+@section('content')
+
+
+
+
+
+
+
{{ $title }}
+
+
+
+ - Dashboards
+ - {{ $title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+@endsection
+
+@push('js')
+
+@endpush
diff --git a/Modules/User/resources/views/index.blade.php b/Modules/User/resources/views/index.blade.php
new file mode 100644
index 0000000..f279725
--- /dev/null
+++ b/Modules/User/resources/views/index.blade.php
@@ -0,0 +1,73 @@
+@extends('layouts.app')
+@section('content')
+
+ @include('user::partials.view')
+@endsection
diff --git a/Modules/User/resources/views/layouts/master.blade.php b/Modules/User/resources/views/layouts/master.blade.php
new file mode 100644
index 0000000..7b82912
--- /dev/null
+++ b/Modules/User/resources/views/layouts/master.blade.php
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+ User Module - {{ config('app.name', 'Laravel') }}
+
+
+
+
+
+
+
+
+
+ {{-- Vite CSS --}}
+ {{-- {{ module_vite('build-user', 'resources/assets/sass/app.scss') }} --}}
+
+
+
+ @yield('content')
+
+ {{-- Vite JS --}}
+ {{-- {{ module_vite('build-user', 'resources/assets/js/app.js') }} --}}
+
diff --git a/Modules/User/resources/views/partials/action.blade.php b/Modules/User/resources/views/partials/action.blade.php
new file mode 100644
index 0000000..973a5f3
--- /dev/null
+++ b/Modules/User/resources/views/partials/action.blade.php
@@ -0,0 +1,23 @@
+
+
+
+
+ Please enter employee name.
+
+
+
+
+
+
+
+
+
+
+
+
+
+@push('js')
+
+@endpush
diff --git a/Modules/User/resources/views/partials/view.blade.php b/Modules/User/resources/views/partials/view.blade.php
new file mode 100644
index 0000000..00dc733
--- /dev/null
+++ b/Modules/User/resources/views/partials/view.blade.php
@@ -0,0 +1,16 @@
+
diff --git a/Modules/User/routes/.gitkeep b/Modules/User/routes/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/User/routes/api.php b/Modules/User/routes/api.php
new file mode 100644
index 0000000..4b69013
--- /dev/null
+++ b/Modules/User/routes/api.php
@@ -0,0 +1,19 @@
+prefix('v1')->group(function () {
+ Route::apiResource('user', UserController::class)->names('user');
+});
diff --git a/Modules/User/routes/web.php b/Modules/User/routes/web.php
new file mode 100644
index 0000000..c43ce3b
--- /dev/null
+++ b/Modules/User/routes/web.php
@@ -0,0 +1,19 @@
+names('user');
+});
diff --git a/Modules/User/vite.config.js b/Modules/User/vite.config.js
new file mode 100644
index 0000000..3fce796
--- /dev/null
+++ b/Modules/User/vite.config.js
@@ -0,0 +1,26 @@
+import { defineConfig } from 'vite';
+import laravel from 'laravel-vite-plugin';
+
+export default defineConfig({
+ build: {
+ outDir: '../../public/build-user',
+ emptyOutDir: true,
+ manifest: true,
+ },
+ plugins: [
+ laravel({
+ publicDirectory: '../../public',
+ buildDirectory: 'build-user',
+ input: [
+ __dirname + '/resources/assets/sass/app.scss',
+ __dirname + '/resources/assets/js/app.js'
+ ],
+ refresh: true,
+ }),
+ ],
+});
+
+//export const paths = [
+// 'Modules/User/resources/assets/sass/app.scss',
+// 'Modules/User/resources/assets/js/app.js',
+//];
\ No newline at end of file
diff --git a/app/Http/Controllers/CountriesController.php b/app/Http/Controllers/CountriesController.php
index 5a66f25..c78a8f2 100644
--- a/app/Http/Controllers/CountriesController.php
+++ b/app/Http/Controllers/CountriesController.php
@@ -1,218 +1,211 @@
modelService = new CommonModelService($model);
- }
- public function index(Request $request)
- {
- createActivityLog(CountriesController::class, 'index', ' Countries index');
- $data = Countries::where('status','<>',-1)->orderBy('display_order')->get();
-
- return view("crud.generated.countries.index", compact('data'));
- }
+use App\Http\Controllers\Controller;
+use App\Models\Country\Country;
+use App\Service\CommonModelService;
+use Exception;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Validator;
+use Log;
- public function create(Request $request)
- {
- createActivityLog(CountriesController::class, 'create', ' Countries create');
- $TableData = Countries::where('status','<>',-1)->orderBy('display_order')->get();
- $editable=false;
- return view("crud.generated.countries.edit",compact('TableData','editable'));
- }
+class CountriesController extends Controller
+{
+ protected $modelService;
+ public function __construct(Country $model)
+ {
+ $this->modelService = new CommonModelService($model);
+ }
+ public function index(Request $request)
+ {
+ // createActivityLog(CountriesController::class, 'index', ' Country index');
+ $data = Country::where('status', '<>', -1)->orderBy('display_order')->get();
- public function store(Request $request)
- {
- createActivityLog(CountriesController::class, 'store', ' Countries store');
- $validator = Validator::make($request->all(), [
- //ADD REQUIRED FIELDS FOR VALIDATION
- ]);
+ return view("crud.generated.countries.index", compact('data'));
+ }
- if ($validator->fails()) {
- return response()->json([
- 'error' => $validator->errors(),
- ],500);
- }
- $request->request->add(['alias' => slugify($request->title)]);
- $request->request->add(['display_order' => getDisplayOrder('tbl_countries')]);
- $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(CountriesController::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 Countries Created Successfully.'], 200);
- }
- return redirect()->route('countries.index')->with('success','The Countries created Successfully.');
- }
-
- public function sort(Request $request)
- {
- $idOrder = $request->input('id_order');
-
- foreach ($idOrder as $index => $id) {
- $companyArticle = Countries::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 = Countries::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 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'));
+ }
- public function show(Request $request, $id)
- {
- createActivityLog(CountriesController::class, 'show', ' Countries show');
- $data = Countries::findOrFail($id);
-
- return view("crud.generated.countries.show", compact('data'));
- }
+ public function store(Request $request)
+ {
+ // createActivityLog(CountriesController::class, 'store', ' Country store');
+ $validator = Validator::make($request->all(), [
+ //ADD REQUIRED FIELDS FOR VALIDATION
+ ]);
-
- public function edit(Request $request, $id)
- {
- createActivityLog(CountriesController::class, 'edit', ' Countries edit');
- $TableData = Countries::where('status','<>',-1)->orderBy('display_order')->get();
- $data = Countries::findOrFail($id);
- $editable=true;
- return view("crud.generated.countries.edit", compact('data','TableData','editable'));
- }
-
-
- public function update(Request $request, $id)
- {
- createActivityLog(CountriesController::class, 'update', ' Countries 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('country_id'));
- } catch (Exception $e) {
- DB::rollBack();
- Log::info($e->getMessage());
- createErrorLog(CountriesController::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 Countries updated Successfully.'], 200);
- }
- // return redirect()->route('countries.index')->with('success','The Countries updated Successfully.');
- return redirect()->back()->with('success', 'The Countries updated successfully.');
- }
-
- public function destroy(Request $request,$id)
- {
- createActivityLog(CountriesController::class, 'destroy', ' Countries destroy');
- DB::beginTransaction();
- try {
- $OperationNumber = getOperationNumber();
- $this->modelService->destroy($OperationNumber, $OperationNumber, $id);
- } catch (Exception $e) {
- DB::rollBack();
- Log::info($e->getMessage());
- createErrorLog(CountriesController::class, 'destroy', $e->getMessage());
- return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
- }
- DB::commit();
- return response()->json(['status'=>true,'message'=>'The Countries Deleted Successfully.'],200);
- }
- public function toggle(Request $request,$id)
- {
- createActivityLog(CountriesController::class, 'destroy', ' Countries destroy');
- $data = Countries::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(CountriesController::class, 'destroy', $e->getMessage());
- return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
- }
- DB::commit();
- return response()->json(['status'=>true,'message'=>'The Countries Deleted Successfully.'],200);
- }
- public function clone(Request $request,$id)
- {
- createActivityLog(CountriesController::class, 'clone', ' Countries clone');
- $data = Countries::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(CountriesController::class, 'clone', $e->getMessage());
- return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
- }
- DB::commit();
- return response()->json(['status'=>true,'message'=>'The Countries Clonned Successfully.'],200);
- }
-
-
-
+ if ($validator->fails()) {
+ return response()->json([
+ 'error' => $validator->errors(),
+ ], 500);
}
-
\ No newline at end of file
+ $request->request->add(['alias' => slugify($request->title)]);
+ $request->request->add(['display_order' => getDisplayOrder('tbl_countries')]);
+ $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(CountriesController::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 Country Created Successfully.'], 200);
+ }
+ return redirect()->route('countries.index')->with('success', 'The Country created Successfully.');
+ }
+
+ public function sort(Request $request)
+ {
+ $idOrder = $request->input('id_order');
+
+ foreach ($idOrder as $index => $id) {
+ $companyArticle = Country::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 = Country::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(CountriesController::class, 'show', ' Country show');
+ $data = Country::findOrFail($id);
+
+ return view("crud.generated.countries.show", compact('data'));
+ }
+
+ public function edit(Request $request, $id)
+ {
+ // createActivityLog(CountriesController::class, 'edit', ' Country edit');
+ $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'));
+ }
+
+ public function update(Request $request, $id)
+ {
+ // createActivityLog(CountriesController::class, 'update', ' Country 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('country_id'));
+ } catch (Exception $e) {
+ DB::rollBack();
+ Log::info($e->getMessage());
+ createErrorLog(CountriesController::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 Country updated Successfully.'], 200);
+ }
+ // return redirect()->route('countries.index')->with('success','The Country updated Successfully.');
+ return redirect()->back()->with('success', 'The Country updated successfully.');
+ }
+
+ public function destroy(Request $request, $id)
+ {
+ // createActivityLog(CountriesController::class, 'destroy', ' Country destroy');
+ DB::beginTransaction();
+ try {
+ $OperationNumber = getOperationNumber();
+ $this->modelService->destroy($OperationNumber, $OperationNumber, $id);
+ } catch (Exception $e) {
+ DB::rollBack();
+ Log::info($e->getMessage());
+ createErrorLog(CountriesController::class, 'destroy', $e->getMessage());
+ return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
+ }
+ DB::commit();
+ return response()->json(['status' => true, 'message' => 'The Country Deleted Successfully.'], 200);
+ }
+ public function toggle(Request $request, $id)
+ {
+ // createActivityLog(CountriesController::class, 'destroy', ' Country destroy');
+ $data = Country::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(CountriesController::class, 'destroy', $e->getMessage());
+ return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
+ }
+ DB::commit();
+ return response()->json(['status' => true, 'message' => 'The Country Deleted Successfully.'], 200);
+ }
+ public function clone (Request $request, $id)
+ {
+ // createActivityLog(CountriesController::class, 'clone', ' Country clone');
+ $data = Country::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(CountriesController::class, 'clone', $e->getMessage());
+ return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
+ }
+ DB::commit();
+ return response()->json(['status' => true, 'message' => 'The Country Clonned Successfully.'], 200);
+ }
+
+}
diff --git a/app/Http/Controllers/GeneralFormController.php b/app/Http/Controllers/GeneralFormController.php
index d70ba25..44b0c51 100644
--- a/app/Http/Controllers/GeneralFormController.php
+++ b/app/Http/Controllers/GeneralFormController.php
@@ -2,7 +2,6 @@
namespace App\Http\Controllers;
-use App\Helpers\BibClass;
use App\Http\Controllers\Controller;
use Exception;
use Illuminate\Http\Request;
@@ -41,7 +40,7 @@ class GeneralFormController extends Controller
'icon',
'favicon',
'og_image',
- 'no_image'
+ 'no_image',
);
self::$textEditorFields = array('details', 'description', 'text', 'qualification', 'experience', 'required_documents', 'biodata', 'privacy_policy', 'content1', 'content2', 'content3');
self::$textAreaFields = array('copyright', 'remarks', 'seo_keywords', 'seo_description', 'seo_descriptions', 'intro', 'meta_tags', 'google_map', 'og_tags');
@@ -67,10 +66,10 @@ class GeneralFormController extends Controller
$databasdeName = DB::connection()->getDatabaseName();
$allTables = [];
foreach ($tables as $table) {
-
+
$table_field = "Tables_in_$databasdeName";
// dd($table->$table_field);
- if(strpos($table->$table_field,"_logs")){continue;}
+ if (strpos($table->$table_field, "_logs")) {continue;}
$allTables[$table->$table_field] = $table->$table_field;
}
return view('crud.form.create', compact('allTables'));
@@ -79,7 +78,6 @@ class GeneralFormController extends Controller
}
}
-
public function store(Request $request)
{
// dd($request->all());
@@ -111,8 +109,6 @@ class GeneralFormController extends Controller
$data['TableRows'] = DB::select("select * from " . $data['TableName']);
return view("crud.settings.dictonary", $data);
-
-
case 'curd':
$data['tableName'] = $tableName;
$data['directoryName'] = $directoryName;
@@ -162,7 +158,7 @@ class GeneralFormController extends Controller
$string = '_id';
$foreign = [];
foreach ($all_columns as $key => $column) {
- if (str_contains($column, $string) !== FALSE) { // Yoshi version
+ if (str_contains($column, $string) !== false) { // Yoshi version
$foreign[] = $column;
}
}
@@ -188,8 +184,6 @@ class GeneralFormController extends Controller
return array_column(DB::select("SHOW COLUMNS FROM $TableName"), 'Field');
}
-
-
public static function ajaxShowContent($TableName, $directoryName)
{
$TableName = strtolower($TableName);
@@ -206,20 +200,23 @@ class GeneralFormController extends Controller
$Table_pk = str_replace("tbl_", "", $TableName) . "_id";
$title = ucwords(str_replace("tbl_", "", $TableName));
$showContent = "
-
-
+
+
";
foreach ($TableCols as $key => $TableCol):
$TableCol = $TableCol->Field;
- if ($key == 0 || $TableCol == 'createdOn' || $TableCol == 'createdBy' || $TableCol == 'updatedBy' || $TableCol == 'created_at' || $TableCol == 'updated_at')
+ if ($key == 0 || $TableCol == 'createdOn' || $TableCol == 'createdBy' || $TableCol == 'updatedBy' || $TableCol == 'created_at' || $TableCol == 'updated_at') {
continue;
+ }
+
$TableColLabel = ucwords(str_replace("_", " ", $TableCol));
- if ($TableCol == 'status')
+ if ($TableCol == 'status') {
$showContent .= "Status : $TableCol == 1 ? 'text-success' : 'text-danger'}}\">{{\$data->$TableCol == 1 ? 'Active' : 'Inactive'}}
";
- else
+ class=\"{{\$data->$TableCol == 1 ? 'text-success' : 'text-danger'}}\">{{\$data->$TableCol == 1 ? 'Active' : 'Inactive'}}";
+ } else {
$showContent .= '' . $TableColLabel . " : {{\$data->$TableCol}}
";
+ }
endforeach;
$showContent .= "
@@ -257,12 +254,12 @@ class GeneralFormController extends Controller
$Table_pk = $all_columns[0];
$all_foreign_table = self::getForeignTable($all_columns);
$all_foreignKey = [];
- if ($all_foreign_table)
+ if ($all_foreign_table) {
foreach ($all_foreign_table as $key => $tablename) {
$all_foreignKey[$tablename] = self::getTableColumns($tablename);
$all_foreignKey[$tablename] = $all_foreignKey[$tablename][0] ?? null;
}
-
+ }
$editContent = "
";
break;
- case (strpos($TableCol, "s_id") !== false): //CASE TO HANDLE FOREIGN TABLE
+ case (strpos($TableCol, "s_id") !== false): //CASE TO HANDLE FOREIGN TABLE
$FTNameRaw = str_replace("s_id", "s", $TableCol);
$FTName = "tbl_" . str_replace("s_id", "s", $TableCol);
$FTCols = DB::select("describe " . $FTName);
@@ -325,7 +322,6 @@ class GeneralFormController extends Controller
}
}
-
endforeach;
$editContent .= ' ';
$editContent .= "\n";
@@ -333,8 +329,6 @@ class GeneralFormController extends Controller
$editContent .= "
";
$editContent .= " ";
-
-
return $editContent;
} //end of ajaxEditContent method
public static function editContent($TableName, $directoryName)
@@ -352,7 +346,7 @@ class GeneralFormController extends Controller
$folder .= str_replace("tbl_", "", $TableName);
$Table_pk = str_replace("tbl_", "", $TableName) . "_id";
$title = ucwords(str_replace("tbl_", "", $TableName));
- $editContent = "@extends('backend.template')
+ $editContent = "@extends('layouts.app')
@section('content')