Compare commits
10 Commits
df0cbdf8a0
...
7d7f7223f6
Author | SHA1 | Date | |
---|---|---|---|
7d7f7223f6 | |||
73b666affc | |||
f4718d7d55 | |||
3324d7e3ae | |||
d36571ba7a | |||
6717db6f4a | |||
f7b7d80b87 | |||
|
5cc42edcba | ||
89d7a82f03 | |||
dfdc927a56 |
67
Modules/Employee/Http/Controllers/EmployeeController.php
Normal file
67
Modules/Employee/Http/Controllers/EmployeeController.php
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Employee\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\RedirectResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
|
||||||
|
class EmployeeController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return view('employee::index');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('employee::create');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(Request $request): RedirectResponse
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the specified resource.
|
||||||
|
*/
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
return view('employee::show');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*/
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
return view('employee::edit');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(Request $request, $id): RedirectResponse
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
114
Modules/Employee/Providers/EmployeeServiceProvider.php
Normal file
114
Modules/Employee/Providers/EmployeeServiceProvider.php
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Employee\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Blade;
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
|
class EmployeeServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
protected string $moduleName = 'Employee';
|
||||||
|
|
||||||
|
protected string $moduleNameLower = 'employee';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boot the application events.
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
$this->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;
|
||||||
|
}
|
||||||
|
}
|
49
Modules/Employee/Providers/RouteServiceProvider.php
Normal file
49
Modules/Employee/Providers/RouteServiceProvider.php
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Employee\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||||
|
|
||||||
|
class RouteServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Called before routes are registered.
|
||||||
|
*
|
||||||
|
* Register any model bindings or pattern based filters.
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the routes for the application.
|
||||||
|
*/
|
||||||
|
public function map(): void
|
||||||
|
{
|
||||||
|
$this->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('Employee', '/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('Employee', '/routes/api.php'));
|
||||||
|
}
|
||||||
|
}
|
30
Modules/Employee/composer.json
Normal file
30
Modules/Employee/composer.json
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"name": "nwidart/employee",
|
||||||
|
"description": "",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicolas Widart",
|
||||||
|
"email": "n.widart@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extra": {
|
||||||
|
"laravel": {
|
||||||
|
"providers": [],
|
||||||
|
"aliases": {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Modules\\Employee\\": "app/",
|
||||||
|
"Modules\\Employee\\Database\\Factories\\": "database/factories/",
|
||||||
|
"Modules\\Employee\\Database\\Seeders\\": "database/seeders/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload-dev": {
|
||||||
|
"psr-4": {
|
||||||
|
"Modules\\Employee\\Tests\\": "tests/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
0
Modules/Employee/config/.gitkeep
Normal file
0
Modules/Employee/config/.gitkeep
Normal file
5
Modules/Employee/config/config.php
Normal file
5
Modules/Employee/config/config.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'name' => 'Employee',
|
||||||
|
];
|
0
Modules/Employee/database/migrations/.gitkeep
Normal file
0
Modules/Employee/database/migrations/.gitkeep
Normal file
0
Modules/Employee/database/seeders/.gitkeep
Normal file
0
Modules/Employee/database/seeders/.gitkeep
Normal file
16
Modules/Employee/database/seeders/EmployeeDatabaseSeeder.php
Normal file
16
Modules/Employee/database/seeders/EmployeeDatabaseSeeder.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Employee\database\seeders;
|
||||||
|
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class EmployeeDatabaseSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
// $this->call([]);
|
||||||
|
}
|
||||||
|
}
|
11
Modules/Employee/module.json
Normal file
11
Modules/Employee/module.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"name": "Employee",
|
||||||
|
"alias": "employee",
|
||||||
|
"description": "",
|
||||||
|
"keywords": [],
|
||||||
|
"priority": 0,
|
||||||
|
"providers": [
|
||||||
|
"Modules\\Employee\\Providers\\EmployeeServiceProvider"
|
||||||
|
],
|
||||||
|
"files": []
|
||||||
|
}
|
15
Modules/Employee/package.json
Normal file
15
Modules/Employee/package.json
Normal file
@ -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"
|
||||||
|
}
|
||||||
|
}
|
0
Modules/Employee/resources/assets/.gitkeep
Normal file
0
Modules/Employee/resources/assets/.gitkeep
Normal file
0
Modules/Employee/resources/assets/js/app.js
Normal file
0
Modules/Employee/resources/assets/js/app.js
Normal file
0
Modules/Employee/resources/assets/sass/app.scss
Normal file
0
Modules/Employee/resources/assets/sass/app.scss
Normal file
0
Modules/Employee/resources/views/.gitkeep
Normal file
0
Modules/Employee/resources/views/.gitkeep
Normal file
1043
Modules/Employee/resources/views/index.blade.php
Normal file
1043
Modules/Employee/resources/views/index.blade.php
Normal file
File diff suppressed because it is too large
Load Diff
29
Modules/Employee/resources/views/layouts/master.blade.php
Normal file
29
Modules/Employee/resources/views/layouts/master.blade.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
|
||||||
|
<title>Employee Module - {{ config('app.name', 'Laravel') }}</title>
|
||||||
|
|
||||||
|
<meta name="description" content="{{ $description ?? '' }}">
|
||||||
|
<meta name="keywords" content="{{ $keywords ?? '' }}">
|
||||||
|
<meta name="author" content="{{ $author ?? '' }}">
|
||||||
|
|
||||||
|
<!-- Fonts -->
|
||||||
|
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||||
|
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
||||||
|
|
||||||
|
{{-- Vite CSS --}}
|
||||||
|
{{-- {{ module_vite('build-employee', 'resources/assets/sass/app.scss') }} --}}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
@yield('content')
|
||||||
|
|
||||||
|
{{-- Vite JS --}}
|
||||||
|
{{-- {{ module_vite('build-employee', 'resources/assets/js/app.js') }} --}}
|
||||||
|
</body>
|
2112
Modules/Employee/resources/views/show.blade.php
Normal file
2112
Modules/Employee/resources/views/show.blade.php
Normal file
File diff suppressed because it is too large
Load Diff
0
Modules/Employee/routes/.gitkeep
Normal file
0
Modules/Employee/routes/.gitkeep
Normal file
19
Modules/Employee/routes/api.php
Normal file
19
Modules/Employee/routes/api.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use Modules\Employee\Http\Controllers\EmployeeController;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*--------------------------------------------------------------------------
|
||||||
|
* API Routes
|
||||||
|
*--------------------------------------------------------------------------
|
||||||
|
*
|
||||||
|
* Here is where you can register API routes for your application. These
|
||||||
|
* routes are loaded by the RouteServiceProvider within a group which
|
||||||
|
* is assigned the "api" middleware group. Enjoy building your API!
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
Route::middleware(['auth:sanctum'])->prefix('v1')->group(function () {
|
||||||
|
Route::apiResource('employee', EmployeeController::class)->names('employee');
|
||||||
|
});
|
19
Modules/Employee/routes/web.php
Normal file
19
Modules/Employee/routes/web.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use Modules\Employee\Http\Controllers\EmployeeController;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Web Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here is where you can register web routes for your application. These
|
||||||
|
| routes are loaded by the RouteServiceProvider within a group which
|
||||||
|
| contains the "web" middleware group. Now create something great!
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
Route::group([], function () {
|
||||||
|
Route::resource('employee', EmployeeController::class)->names('employee');
|
||||||
|
});
|
26
Modules/Employee/vite.config.js
Normal file
26
Modules/Employee/vite.config.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import { defineConfig } from 'vite';
|
||||||
|
import laravel from 'laravel-vite-plugin';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
build: {
|
||||||
|
outDir: '../../public/build-employee',
|
||||||
|
emptyOutDir: true,
|
||||||
|
manifest: true,
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
laravel({
|
||||||
|
publicDirectory: '../../public',
|
||||||
|
buildDirectory: 'build-employee',
|
||||||
|
input: [
|
||||||
|
__dirname + '/resources/assets/sass/app.scss',
|
||||||
|
__dirname + '/resources/assets/js/app.js'
|
||||||
|
],
|
||||||
|
refresh: true,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
//export const paths = [
|
||||||
|
// 'Modules/Employee/resources/assets/sass/app.scss',
|
||||||
|
// 'Modules/Employee/resources/assets/js/app.js',
|
||||||
|
//];
|
@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Modules\Leave\Models;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
||||||
use Modules\Leave\Database\factories\LeaveFactory;
|
|
||||||
|
|
||||||
class Leave extends Model
|
|
||||||
{
|
|
||||||
use HasFactory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The attributes that are mass assignable.
|
|
||||||
*/
|
|
||||||
protected $fillable = [];
|
|
||||||
|
|
||||||
protected static function newFactory(): LeaveFactory
|
|
||||||
{
|
|
||||||
//return LeaveFactory::new();
|
|
||||||
}
|
|
||||||
}
|
|
0
Modules/Leave/app/Http/Controllers/.gitkeep
Normal file
0
Modules/Leave/app/Http/Controllers/.gitkeep
Normal file
@ -22,6 +22,7 @@ class LeaveController extends Controller
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$data['leaves'] = $this->leaveRepository->findAll();
|
$data['leaves'] = $this->leaveRepository->findAll();
|
||||||
|
// dd($data['leaves']);
|
||||||
return view('leave::index');
|
return view('leave::index');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +40,14 @@ class LeaveController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function store(Request $request): RedirectResponse
|
public function store(Request $request): RedirectResponse
|
||||||
{
|
{
|
||||||
dd($request->all());
|
$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');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
0
Modules/Leave/app/Http/Requests/.gitkeep
Normal file
0
Modules/Leave/app/Http/Requests/.gitkeep
Normal file
0
Modules/Leave/app/Models/.gitkeep
Normal file
0
Modules/Leave/app/Models/.gitkeep
Normal file
12
Modules/Leave/app/Models/Leave.php
Normal file
12
Modules/Leave/app/Models/Leave.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Leave\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Leave extends Model
|
||||||
|
{
|
||||||
|
protected $table = 'leaves';
|
||||||
|
protected $guarded = [];
|
||||||
|
|
||||||
|
}
|
0
Modules/Leave/app/Providers/.gitkeep
Normal file
0
Modules/Leave/app/Providers/.gitkeep
Normal file
@ -4,6 +4,9 @@ namespace Modules\Leave\Providers;
|
|||||||
|
|
||||||
use Illuminate\Support\Facades\Blade;
|
use Illuminate\Support\Facades\Blade;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Modules\Leave\Repositories\LeaveInterface;
|
||||||
|
use Modules\Leave\Repositories\LeaveRepository;
|
||||||
|
|
||||||
|
|
||||||
class LeaveServiceProvider extends ServiceProvider
|
class LeaveServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@ -29,6 +32,7 @@ class LeaveServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
|
$this->app->bind(LeaveInterface::class, LeaveRepository::class);
|
||||||
$this->app->register(RouteServiceProvider::class);
|
$this->app->register(RouteServiceProvider::class);
|
||||||
}
|
}
|
||||||
|
|
0
Modules/Leave/app/Repositories/.gitkeep
Normal file
0
Modules/Leave/app/Repositories/.gitkeep
Normal file
@ -8,7 +8,7 @@ class LeaveRepository implements LeaveInterface
|
|||||||
{
|
{
|
||||||
public function findAll()
|
public function findAll()
|
||||||
{
|
{
|
||||||
return Leave::all();
|
return Leave::get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLeaveById($leaveId)
|
public function getLeaveById($leaveId)
|
0
Modules/Leave/database/factories/.gitkeep
Normal file
0
Modules/Leave/database/factories/.gitkeep
Normal file
@ -12,8 +12,10 @@ return new class extends Migration
|
|||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('leaves', function (Blueprint $table) {
|
Schema::create('leaves', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->tinyInteger('leave_id')->unsigned()->autoIncrement();
|
||||||
|
$table->integer('employee_id');
|
||||||
|
$table->date('start_date');
|
||||||
|
$table->date('end_date');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,8 @@
|
|||||||
<div class="col-lg-8">
|
<div class="col-lg-8">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form action="">
|
<form action="{{ route('leave.store') }}" method="post" class="needs-validation" novalidate>
|
||||||
|
@csrf
|
||||||
@include('leave::partials.action')
|
@include('leave::partials.action')
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@ -37,3 +38,7 @@
|
|||||||
<!-- container-fluid -->
|
<!-- container-fluid -->
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||||
|
@endpush
|
||||||
|
@ -1,22 +1,26 @@
|
|||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="employeeName" class="form-label">Employee Name</label>
|
<label for="employeeName" class="form-label">Employee Name</label>
|
||||||
<input type="text" class="form-control" id="employeeName" placeholder="Enter emploree name">
|
<input type="text" class="form-control" id="employeeName" placeholder="Enter emploree name" name="employeeName"
|
||||||
|
required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Please enter Employee Name.
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="employeeUrl" class="form-label">Employee Department URL</label>
|
<label for="employeeUrl" class="form-label">Employee Department URL</label>
|
||||||
<input type="url" class="form-control" id="employeeUrl" placeholder="Enter emploree url">
|
<input type="url" class="form-control" id="employeeUrl" placeholder="Enter emploree url" name="employeeUrl">
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="StartleaveDate" class="form-label">Start Leave Date</label>
|
<label for="StartleaveDate" class="form-label">Start Leave Date</label>
|
||||||
<input type="date" class="form-control" id="StartleaveDate">
|
<input type="date" class="form-control" id="StartleaveDate" name="start_date">
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="EndleaveDate" class="form-label">End Leave Date</label>
|
<label for="EndleaveDate" class="form-label">End Leave Date</label>
|
||||||
<input type="date" class="form-control" id="EndleaveDate">
|
<input type="date" class="form-control" id="EndleaveDate" name="end_date">
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="VertimeassageInput" class="form-label">Message</label>
|
<label for="VertimeassageInput" class="form-label">Message</label>
|
||||||
<textarea class="form-control" id="VertimeassageInput" rows="3" placeholder="Enter your message"></textarea>
|
<textarea class="form-control" id="VertimeassageInput" rows="3" placeholder="Enter your message" name="remark"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-end">
|
<div class="text-end">
|
||||||
<button type="submit" class="btn btn-primary">Add Leave</button>
|
<button type="submit" class="btn btn-primary">Add Leave</button>
|
||||||
|
@ -185,7 +185,8 @@ class OMIS
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private function initDB()
|
|
||||||
|
public static function initDB()
|
||||||
{
|
{
|
||||||
static $initialized = false;
|
static $initialized = false;
|
||||||
if (!$initialized) {
|
if (!$initialized) {
|
||||||
@ -225,64 +226,64 @@ class OMIS
|
|||||||
`updated_at` timestamp NULL DEFAULT NULL
|
`updated_at` timestamp NULL DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
");
|
");
|
||||||
DB::statement("CREATE TABLE IF NOT EXISTS `tbl_users` (
|
// DB::statement("CREATE TABLE IF NOT EXISTS `tbl_users` (
|
||||||
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
// `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
`name` varchar(255) NULL,
|
// `name` varchar(255) NULL,
|
||||||
`email` varchar(255) NULL,
|
// `email` varchar(255) NULL,
|
||||||
`username` varchar(255) NULL,
|
// `username` varchar(255) NULL,
|
||||||
`email_verified_at` timestamp NULL DEFAULT NULL,
|
// `email_verified_at` timestamp NULL DEFAULT NULL,
|
||||||
`password` varchar(255) NULL,
|
// `password` varchar(255) NULL,
|
||||||
`remember_token` varchar(100) DEFAULT NULL,
|
// `remember_token` varchar(100) DEFAULT NULL,
|
||||||
`display_order` INT(11) DEFAULT 1,
|
// `display_order` INT(11) DEFAULT 1,
|
||||||
`roles_id` INT(11),
|
// `roles_id` INT(11),
|
||||||
`branches_id` INT(11),
|
// `branches_id` INT(11),
|
||||||
`vendors_id` INT(11),
|
// `vendors_id` INT(11),
|
||||||
`employees_id` INT(11),
|
// `employees_id` INT(11),
|
||||||
`status` INT(11) DEFAULT 1,
|
// `status` INT(11) DEFAULT 1,
|
||||||
`created_at` timestamp NULL DEFAULT NULL,
|
// `created_at` timestamp NULL DEFAULT NULL,
|
||||||
`createdby` INT(11),
|
// `createdby` INT(11),
|
||||||
`updated_at` timestamp NULL DEFAULT NULL,
|
// `updated_at` timestamp NULL DEFAULT NULL,
|
||||||
`updatedby` INT(11)
|
// `updatedby` INT(11)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
// ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
");
|
// ");
|
||||||
DB::statement("CREATE TABLE IF NOT EXISTS tbl_roles (
|
// DB::statement("CREATE TABLE IF NOT EXISTS tbl_roles (
|
||||||
role_id INT(11) AUTO_INCREMENT PRIMARY KEY,
|
// role_id INT(11) AUTO_INCREMENT PRIMARY KEY,
|
||||||
title VARCHAR(255),
|
// title VARCHAR(255),
|
||||||
alias VARCHAR(255),
|
// alias VARCHAR(255),
|
||||||
description TEXT,
|
// description TEXT,
|
||||||
display_order INT(11),
|
// display_order INT(11),
|
||||||
status INT(11),
|
// status INT(11),
|
||||||
remarks TEXT,
|
// remarks TEXT,
|
||||||
created_at DATETIME,
|
// created_at DATETIME,
|
||||||
createdby INT(11),
|
// createdby INT(11),
|
||||||
updated_at DATETIME,
|
// updated_at DATETIME,
|
||||||
updatedby INT(11)
|
// updatedby INT(11)
|
||||||
);");
|
// );");
|
||||||
DB::statement("CREATE TABLE IF NOT EXISTS tbl_permissions (
|
// DB::statement("CREATE TABLE IF NOT EXISTS tbl_permissions (
|
||||||
permission_id INT(11) AUTO_INCREMENT PRIMARY KEY,
|
// permission_id INT(11) AUTO_INCREMENT PRIMARY KEY,
|
||||||
title VARCHAR(255),
|
// title VARCHAR(255),
|
||||||
alias VARCHAR(255),
|
// alias VARCHAR(255),
|
||||||
modal VARCHAR(255),
|
// modal VARCHAR(255),
|
||||||
command VARCHAR(255),
|
// command VARCHAR(255),
|
||||||
created_at DATETIME,
|
// created_at DATETIME,
|
||||||
createdby INT(11),
|
// createdby INT(11),
|
||||||
updated_at DATETIME,
|
// updated_at DATETIME,
|
||||||
updatedby INT(11),
|
// updatedby INT(11),
|
||||||
status INT(11)
|
// status INT(11)
|
||||||
|
|
||||||
);");
|
// );");
|
||||||
DB::statement("CREATE TABLE IF NOT EXISTS tbl_rolepermissions (
|
// DB::statement("CREATE TABLE IF NOT EXISTS tbl_rolepermissions (
|
||||||
rolepermission_id INT(11) AUTO_INCREMENT PRIMARY KEY,
|
// rolepermission_id INT(11) AUTO_INCREMENT PRIMARY KEY,
|
||||||
roles_id INT(11),
|
// roles_id INT(11),
|
||||||
permissions_id INT(11),
|
// permissions_id INT(11),
|
||||||
display_order INT(11),
|
// display_order INT(11),
|
||||||
remarks VARCHAR(255),
|
// remarks VARCHAR(255),
|
||||||
created_at DATETIME,
|
// created_at DATETIME,
|
||||||
createdby INT(11),
|
// createdby INT(11),
|
||||||
updated_at DATETIME,
|
// updated_at DATETIME,
|
||||||
updatedby INT(11),
|
// updatedby INT(11),
|
||||||
status INT(11)
|
// status INT(11)
|
||||||
);");
|
// );");
|
||||||
DB::statement("CREATE TABLE IF NOT EXISTS `tbl_settings` (
|
DB::statement("CREATE TABLE IF NOT EXISTS `tbl_settings` (
|
||||||
`setting_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
`setting_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
`title` varchar(255) NULL,
|
`title` varchar(255) NULL,
|
||||||
@ -509,8 +510,7 @@ class OMIS
|
|||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
");
|
");
|
||||||
|
|
||||||
DB::statement("
|
DB::statement("CREATE TABLE IF NOT EXISTS `tbl_castes` (
|
||||||
CREATE TABLE IF NOT EXISTS `tbl_castes` (
|
|
||||||
`caste_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
`caste_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
`title` varchar(255) DEFAULT NULL,
|
`title` varchar(255) DEFAULT NULL,
|
||||||
`alias` varchar(255) DEFAULT NULL,
|
`alias` varchar(255) DEFAULT NULL,
|
||||||
@ -524,8 +524,7 @@ class OMIS
|
|||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
");
|
");
|
||||||
|
|
||||||
DB::statement("
|
DB::statement("CREATE TABLE IF NOT EXISTS `tbl_ethnicities` (
|
||||||
CREATE TABLE IF NOT EXISTS `tbl_ethnicities` (
|
|
||||||
`ethnicity_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
`ethnicity_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
`title` varchar(255) DEFAULT NULL,
|
`title` varchar(255) DEFAULT NULL,
|
||||||
`alias` varchar(255) DEFAULT NULL,
|
`alias` varchar(255) DEFAULT NULL,
|
||||||
@ -539,8 +538,7 @@ class OMIS
|
|||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
");
|
");
|
||||||
|
|
||||||
DB::statement("
|
DB::statement("CREATE TABLE IF NOT EXISTS `tbl_dags` (
|
||||||
CREATE TABLE IF NOT EXISTS `tbl_dags` (
|
|
||||||
`dag_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
`dag_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
`title` varchar(255) DEFAULT NULL,
|
`title` varchar(255) DEFAULT NULL,
|
||||||
`alias` varchar(255) DEFAULT NULL,
|
`alias` varchar(255) DEFAULT NULL,
|
||||||
@ -554,8 +552,7 @@ class OMIS
|
|||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
");
|
");
|
||||||
|
|
||||||
DB::statement("
|
DB::statement("CREATE TABLE IF NOT EXISTS `tbl_nationalities` (
|
||||||
CREATE TABLE IF NOT EXISTS `tbl_nationalities` (
|
|
||||||
`nationality_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
`nationality_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
`title` varchar(255) DEFAULT NULL,
|
`title` varchar(255) DEFAULT NULL,
|
||||||
`alias` varchar(255) DEFAULT NULL,
|
`alias` varchar(255) DEFAULT NULL,
|
||||||
@ -567,77 +564,76 @@ class OMIS
|
|||||||
`updated_at` timestamp NULL DEFAULT NULL,
|
`updated_at` timestamp NULL DEFAULT NULL,
|
||||||
`updatedby` int(11) DEFAULT NULL
|
`updatedby` int(11) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
");
|
|
||||||
|
|
||||||
DB::statement("
|
|
||||||
CREATE TABLE IF NOT EXISTS `tbl_employees` (
|
|
||||||
`employee_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
`first_name` varchar(255) DEFAULT NULL,
|
|
||||||
`middle_name` varchar(255) DEFAULT NULL,
|
|
||||||
`last_name` varchar(255) DEFAULT NULL,
|
|
||||||
`email` varchar(255) DEFAULT NULL,
|
|
||||||
`genders_id` int(11) DEFAULT NULL,
|
|
||||||
`nepali_dob` date DEFAULT NULL,
|
|
||||||
`dob` date DEFAULT NULL,
|
|
||||||
`nationalities_id` int(11) DEFAULT NULL,
|
|
||||||
`about_me` text,
|
|
||||||
`signature` varchar(255) DEFAULT NULL,
|
|
||||||
`father_name` varchar(255) DEFAULT NULL,
|
|
||||||
`mother_name` varchar(255) DEFAULT NULL,
|
|
||||||
`grand_father_name` varchar(255) DEFAULT NULL,
|
|
||||||
`grand_mother_name` varchar(255) DEFAULT NULL,
|
|
||||||
`spouse` varchar(255) DEFAULT NULL,
|
|
||||||
`contact` varchar(255) DEFAULT NULL,
|
|
||||||
`alt_contact` varchar(255) DEFAULT NULL,
|
|
||||||
`profile_picture` varchar(255) DEFAULT NULL,
|
|
||||||
`users_id` int(11) DEFAULT NULL,
|
|
||||||
`is_login_required` tinyint(1) DEFAULT NULL,
|
|
||||||
`skills` text,
|
|
||||||
`experience` text,
|
|
||||||
`permanent_address` text,
|
|
||||||
`permanent_city` int(11) DEFAULT NULL,
|
|
||||||
`temporary_address` text,
|
|
||||||
`temporary_city` int(11) DEFAULT NULL,
|
|
||||||
`old_system_address` text,
|
|
||||||
`education` text,
|
|
||||||
`castes_id` int(11) DEFAULT NULL,
|
|
||||||
`ethnicities_id` int(11) DEFAULT NULL,
|
|
||||||
`dags_id` int(11) DEFAULT NULL,
|
|
||||||
`title` varchar(255) DEFAULT NULL,
|
|
||||||
`alias` varchar(255) DEFAULT NULL,
|
|
||||||
`status` varchar(255) DEFAULT NULL,
|
|
||||||
`display_order` int(11) DEFAULT NULL,
|
|
||||||
`created_at` timestamp NULL DEFAULT NULL,
|
|
||||||
`createdby` int(11) DEFAULT NULL,
|
|
||||||
`updated_at` timestamp NULL DEFAULT NULL,
|
|
||||||
`updatedby` int(11) DEFAULT NULL,
|
|
||||||
`remarks` varchar(255) DEFAULT NULL
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
|
||||||
");
|
");
|
||||||
|
|
||||||
DB::statement("
|
// DB::statement("CREATE TABLE IF NOT EXISTS `tbl_employees` (
|
||||||
CREATE TABLE IF NOT EXISTS `tbl_onboardings` (
|
// `employee_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
`onboarding_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
// `first_name` varchar(255) DEFAULT NULL,
|
||||||
`doj` datetime DEFAULT NULL,
|
// `middle_name` varchar(255) DEFAULT NULL,
|
||||||
`designations_id` int(11) DEFAULT NULL,
|
// `last_name` varchar(255) DEFAULT NULL,
|
||||||
`position_status` varchar(255) DEFAULT NULL,
|
// `email` varchar(255) DEFAULT NULL,
|
||||||
`departments_id` int(11) DEFAULT NULL,
|
// `genders_id` int(11) DEFAULT NULL,
|
||||||
`shifts_id` int(11) DEFAULT NULL,
|
// `nepali_dob` date DEFAULT NULL,
|
||||||
`agreement` varchar(255) DEFAULT NULL,
|
// `dob` date DEFAULT NULL,
|
||||||
`nda` varchar(255) DEFAULT NULL,
|
// `nationalities_id` int(11) DEFAULT NULL,
|
||||||
`terms` text DEFAULT NULL,
|
// `about_me` text,
|
||||||
`workoptions` varchar(255) DEFAULT NULL,
|
// `signature` varchar(255) DEFAULT NULL,
|
||||||
`title` varchar(255) DEFAULT NULL,
|
// `father_name` varchar(255) DEFAULT NULL,
|
||||||
`alias` varchar(255) DEFAULT NULL,
|
// `mother_name` varchar(255) DEFAULT NULL,
|
||||||
`status` int(11) DEFAULT NULL,
|
// `grand_father_name` varchar(255) DEFAULT NULL,
|
||||||
`remarks` text DEFAULT NULL,
|
// `grand_mother_name` varchar(255) DEFAULT NULL,
|
||||||
`display_order` int(11) DEFAULT NULL,
|
// `spouse` varchar(255) DEFAULT NULL,
|
||||||
`created_at` timestamp NULL DEFAULT NULL,
|
// `contact` varchar(255) DEFAULT NULL,
|
||||||
`createdby` int(11) DEFAULT NULL,
|
// `alt_contact` varchar(255) DEFAULT NULL,
|
||||||
`updated_at` timestamp NULL DEFAULT NULL,
|
// `profile_picture` varchar(255) DEFAULT NULL,
|
||||||
`updatedby` int(11) DEFAULT NULL
|
// `users_id` int(11) DEFAULT NULL,
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
// `is_login_required` tinyint(1) DEFAULT NULL,
|
||||||
");
|
// `skills` text,
|
||||||
|
// `experience` text,
|
||||||
|
// `permanent_address` text,
|
||||||
|
// `permanent_city` int(11) DEFAULT NULL,
|
||||||
|
// `temporary_address` text,
|
||||||
|
// `temporary_city` int(11) DEFAULT NULL,
|
||||||
|
// `old_system_address` text,
|
||||||
|
// `education` text,
|
||||||
|
// `castes_id` int(11) DEFAULT NULL,
|
||||||
|
// `ethnicities_id` int(11) DEFAULT NULL,
|
||||||
|
// `dags_id` int(11) DEFAULT NULL,
|
||||||
|
// `title` varchar(255) DEFAULT NULL,
|
||||||
|
// `alias` varchar(255) DEFAULT NULL,
|
||||||
|
// `status` varchar(255) DEFAULT NULL,
|
||||||
|
// `display_order` int(11) DEFAULT NULL,
|
||||||
|
// `created_at` timestamp NULL DEFAULT NULL,
|
||||||
|
// `createdby` int(11) DEFAULT NULL,
|
||||||
|
// `updated_at` timestamp NULL DEFAULT NULL,
|
||||||
|
// `updatedby` int(11) DEFAULT NULL,
|
||||||
|
// `remarks` varchar(255) DEFAULT NULL
|
||||||
|
// ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
|
// ");
|
||||||
|
|
||||||
|
// DB::statement("
|
||||||
|
// CREATE TABLE IF NOT EXISTS `tbl_onboardings` (
|
||||||
|
// `onboarding_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
// `doj` datetime DEFAULT NULL,
|
||||||
|
// `designations_id` int(11) DEFAULT NULL,
|
||||||
|
// `position_status` varchar(255) DEFAULT NULL,
|
||||||
|
// `departments_id` int(11) DEFAULT NULL,
|
||||||
|
// `shifts_id` int(11) DEFAULT NULL,
|
||||||
|
// `agreement` varchar(255) DEFAULT NULL,
|
||||||
|
// `nda` varchar(255) DEFAULT NULL,
|
||||||
|
// `terms` text DEFAULT NULL,
|
||||||
|
// `workoptions` varchar(255) DEFAULT NULL,
|
||||||
|
// `title` varchar(255) DEFAULT NULL,
|
||||||
|
// `alias` varchar(255) DEFAULT NULL,
|
||||||
|
// `status` int(11) DEFAULT NULL,
|
||||||
|
// `remarks` text DEFAULT NULL,
|
||||||
|
// `display_order` int(11) DEFAULT NULL,
|
||||||
|
// `created_at` timestamp NULL DEFAULT NULL,
|
||||||
|
// `createdby` int(11) DEFAULT NULL,
|
||||||
|
// `updated_at` timestamp NULL DEFAULT NULL,
|
||||||
|
// `updatedby` int(11) DEFAULT NULL
|
||||||
|
// ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
|
// ");
|
||||||
|
|
||||||
// Dharamaraj
|
// Dharamaraj
|
||||||
|
|
||||||
@ -705,58 +701,43 @@ class OMIS
|
|||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
");
|
");
|
||||||
|
|
||||||
DB::statement("
|
// DB::statement("
|
||||||
CREATE TABLE IF NOT EXISTS `tbl_leavetypes` (
|
// CREATE TABLE IF NOT EXISTS `tbl_leavetypes` (
|
||||||
`leavetype_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
// `leavetype_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
`title` varchar(255) DEFAULT NULL,
|
// `title` varchar(255) DEFAULT NULL,
|
||||||
`alias` varchar(255) DEFAULT NULL,
|
// `alias` varchar(255) DEFAULT NULL,
|
||||||
`status` int(11) DEFAULT NULL,
|
// `status` int(11) DEFAULT NULL,
|
||||||
`remarks` text DEFAULT NULL,
|
// `remarks` text DEFAULT NULL,
|
||||||
`display_order` int(11) DEFAULT NULL,
|
// `display_order` int(11) DEFAULT NULL,
|
||||||
`created_at` timestamp NULL DEFAULT NULL,
|
// `created_at` timestamp NULL DEFAULT NULL,
|
||||||
`createdby` int(11) DEFAULT NULL,
|
// `createdby` int(11) DEFAULT NULL,
|
||||||
`updated_at` timestamp NULL DEFAULT NULL,
|
// `updated_at` timestamp NULL DEFAULT NULL,
|
||||||
`updatedby` int(11) DEFAULT NULL
|
// `updatedby` int(11) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
// ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
");
|
// ");
|
||||||
|
|
||||||
DB::statement("
|
// if (!(DB::table('users')->first())) {
|
||||||
CREATE TABLE IF NOT EXISTS `tbl_leaves` (
|
// DB::statement("INSERT INTO `users` (`name`,`email`,`username`,`password`,`roles_id`,`status`) VALUES ('Prajwal Adhikari','prajwalbro@hotmail.com','prajwalbro@hotmail.com','$2y$10$3zlF9VeXexzWKRDPZuDio.W7RZIC3tU.cjwMoLzG8ki8bVwAQn1WW','1','1');");
|
||||||
`leave_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
// }
|
||||||
`title` varchar(255) DEFAULT NULL,
|
|
||||||
`alias` varchar(255) DEFAULT NULL,
|
|
||||||
`status` int(11) DEFAULT NULL,
|
|
||||||
`remarks` text DEFAULT NULL,
|
|
||||||
`display_order` int(11) DEFAULT NULL,
|
|
||||||
`created_at` timestamp NULL DEFAULT NULL,
|
|
||||||
`createdby` int(11) DEFAULT NULL,
|
|
||||||
`updated_at` timestamp NULL DEFAULT NULL,
|
|
||||||
`updatedby` int(11) DEFAULT NULL,
|
|
||||||
`leavetypes_id` int(11) DEFAULT NULL
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
|
||||||
");
|
|
||||||
|
|
||||||
if (!(DB::table('users')->first())) {
|
// if (!(DB::table('settings')->first())) {
|
||||||
DB::statement("INSERT INTO `tbl_users` (`name`,`email`,`username`,`password`,`roles_id`,`status`) VALUES ('Prajwal Adhikari','prajwalbro@hotmail.com','prajwalbro@hotmail.com','$2y$10$3zlF9VeXexzWKRDPZuDio.W7RZIC3tU.cjwMoLzG8ki8bVwAQn1WW','1','1');");
|
// DB::statement("INSERT INTO `tbl_settings` (`title`, `description`, `status`) VALUES ('Bibhuti OMIS', '', '1');");
|
||||||
}
|
// }
|
||||||
if (!(DB::table('settings')->first())) {
|
|
||||||
DB::statement("INSERT INTO `tbl_settings` (`title`, `description`, `status`) VALUES ('Bibhuti OMIS', '', '1');");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(DB::table('countries')->first())) {
|
// if (!(DB::table('countries')->first())) {
|
||||||
DB::statement("INSERT INTO `tbl_countries` (`title`,`alias`,`status`) VALUES ('Nepal','nepal', '1');");
|
// DB::statement("INSERT INTO `tbl_countries` (`title`,`alias`,`status`) VALUES ('Nepal','nepal', '1');");
|
||||||
}
|
// }
|
||||||
if (!(DB::table('proviences')->first())) {
|
// if (!(DB::table('proviences')->first())) {
|
||||||
DB::statement("INSERT INTO `tbl_proviences` (`title`,`alias`,`status`) VALUES ('Bagmati','bagmati', '1');");
|
// DB::statement("INSERT INTO `tbl_proviences` (`title`,`alias`,`status`) VALUES ('Bagmati','bagmati', '1');");
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!(DB::table('roles')->first())) {
|
// if (!(DB::table('roles')->first())) {
|
||||||
DB::statement("INSERT INTO `tbl_roles` (`title`,`alias`,`status`) VALUES ('Admin','admin','1');");
|
// DB::statement("INSERT INTO `tbl_roles` (`title`,`alias`,`status`) VALUES ('Admin','admin','1');");
|
||||||
DB::statement("INSERT INTO `tbl_roles` (`title`,`alias`,`status`) VALUES ('Manager','manager','1');");
|
// DB::statement("INSERT INTO `tbl_roles` (`title`,`alias`,`status`) VALUES ('Manager','manager','1');");
|
||||||
DB::statement("INSERT INTO `tbl_roles` (`title`,`alias`,`status`) VALUES ('Branch','branch','1');");
|
// DB::statement("INSERT INTO `tbl_roles` (`title`,`alias`,`status`) VALUES ('Branch','branch','1');");
|
||||||
DB::statement("INSERT INTO `tbl_roles` (`title`,`alias`,`status`) VALUES ('Agent','agent','1');");
|
// DB::statement("INSERT INTO `tbl_roles` (`title`,`alias`,`status`) VALUES ('Agent','agent','1');");
|
||||||
DB::statement("INSERT INTO `tbl_roles` (`title`,`alias`,`status`) VALUES ('Student','student','1');");
|
// DB::statement("INSERT INTO `tbl_roles` (`title`,`alias`,`status`) VALUES ('Student','student','1');");
|
||||||
}
|
// }
|
||||||
|
|
||||||
$initialized = true;
|
$initialized = true;
|
||||||
}
|
}
|
||||||
|
@ -29,9 +29,13 @@
|
|||||||
"psr-4": {
|
"psr-4": {
|
||||||
"App\\": "app/",
|
"App\\": "app/",
|
||||||
"Database\\Factories\\": "database/factories/",
|
"Database\\Factories\\": "database/factories/",
|
||||||
"Database\\Seeders\\": "database/seeders/",
|
"Database\\Seeders\\": "database/seeders/"
|
||||||
"Modules\\": "Modules/"
|
},
|
||||||
}
|
"files":[
|
||||||
|
"app/Helpers/OMIS.php",
|
||||||
|
"app/Helpers/BibClass.php",
|
||||||
|
"app/Helpers/bibHelper.php"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@ -59,6 +63,11 @@
|
|||||||
},
|
},
|
||||||
"laravel": {
|
"laravel": {
|
||||||
"dont-discover": []
|
"dont-discover": []
|
||||||
|
},
|
||||||
|
"merge-plugin": {
|
||||||
|
"include": [
|
||||||
|
"Modules/*/composer.json"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
2
composer.lock
generated
2
composer.lock
generated
@ -8865,5 +8865,5 @@
|
|||||||
"php": "^8.1"
|
"php": "^8.1"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": [],
|
||||||
"plugin-api-version": "2.6.0"
|
"plugin-api-version": "2.3.0"
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ return [
|
|||||||
| app folder name
|
| app folder name
|
||||||
| for example can change it to 'src' or 'App'
|
| for example can change it to 'src' or 'App'
|
||||||
*/
|
*/
|
||||||
'app_folder' => '',
|
'app_folder' => 'app/',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@ -112,28 +112,28 @@ return [
|
|||||||
| Setting the generate key to false will not generate that folder
|
| Setting the generate key to false will not generate that folder
|
||||||
*/
|
*/
|
||||||
'generator' => [
|
'generator' => [
|
||||||
//
|
// app/
|
||||||
'channels' => ['path' => 'Broadcasting', 'generate' => false],
|
'channels' => ['path' => 'app/Broadcasting', 'generate' => false],
|
||||||
'command' => ['path' => 'Console', 'generate' => false],
|
'command' => ['path' => 'app/Console', 'generate' => false],
|
||||||
'emails' => ['path' => 'Emails', 'generate' => false],
|
'emails' => ['path' => 'app/Emails', 'generate' => false],
|
||||||
'event' => ['path' => 'Events', 'generate' => false],
|
'event' => ['path' => 'app/Events', 'generate' => false],
|
||||||
'jobs' => ['path' => 'Jobs', 'generate' => false],
|
'jobs' => ['path' => 'app/Jobs', 'generate' => false],
|
||||||
'listener' => ['path' => 'Listeners', 'generate' => false],
|
'listener' => ['path' => 'app/Listeners', 'generate' => false],
|
||||||
'model' => ['path' => 'Models', 'generate' => true],
|
'model' => ['path' => 'app/Models', 'generate' => true],
|
||||||
'notifications' => ['path' => 'Notifications', 'generate' => false],
|
'notifications' => ['path' => 'app/Notifications', 'generate' => false],
|
||||||
'observer' => ['path' => 'Observers', 'generate' => false],
|
'observer' => ['path' => 'app/Observers', 'generate' => false],
|
||||||
'policies' => ['path' => 'Policies', 'generate' => false],
|
'policies' => ['path' => 'app/Policies', 'generate' => false],
|
||||||
'provider' => ['path' => 'Providers', 'generate' => true],
|
'provider' => ['path' => 'app/Providers', 'generate' => true],
|
||||||
'route-provider' => ['path' => 'Providers', 'generate' => true],
|
'route-provider' => ['path' => 'app/Providers', 'generate' => true],
|
||||||
'repository' => ['path' => 'Repositories', 'generate' => true],
|
'repository' => ['path' => 'app/Repositories', 'generate' => true],
|
||||||
'resource' => ['path' => 'Transformers', 'generate' => false],
|
'resource' => ['path' => 'app/Transformers', 'generate' => false],
|
||||||
'rules' => ['path' => 'Rules', 'generate' => false],
|
'rules' => ['path' => 'app/Rules', 'generate' => false],
|
||||||
'component-class' => ['path' => 'View/Components', 'generate' => false],
|
'component-class' => ['path' => 'app/View/Components', 'generate' => false],
|
||||||
|
|
||||||
// Http/
|
// app/Http/
|
||||||
'controller' => ['path' => 'Http/Controllers', 'generate' => true],
|
'controller' => ['path' => 'app/Http/Controllers', 'generate' => true],
|
||||||
'filter' => ['path' => 'Http/Middleware', 'generate' => false],
|
'filter' => ['path' => 'app/Http/Middleware', 'generate' => false],
|
||||||
'request' => ['path' => 'Http/Requests', 'generate' => false],
|
'request' => ['path' => 'app/Http/Requests', 'generate' => true],
|
||||||
|
|
||||||
// config/
|
// config/
|
||||||
'config' => ['path' => 'config', 'generate' => true],
|
'config' => ['path' => 'config', 'generate' => true],
|
||||||
@ -141,7 +141,7 @@ return [
|
|||||||
// database/
|
// database/
|
||||||
'migration' => ['path' => 'database/migrations', 'generate' => true],
|
'migration' => ['path' => 'database/migrations', 'generate' => true],
|
||||||
'seeder' => ['path' => 'database/seeders', 'generate' => true],
|
'seeder' => ['path' => 'database/seeders', 'generate' => true],
|
||||||
'factory' => ['path' => 'database/factories', 'generate' => false],
|
'factory' => ['path' => 'database/factories', 'generate' => true],
|
||||||
|
|
||||||
// lang/
|
// lang/
|
||||||
'lang' => ['path' => 'lang', 'generate' => false],
|
'lang' => ['path' => 'lang', 'generate' => false],
|
||||||
|
@ -4,6 +4,7 @@ namespace Database\Seeders;
|
|||||||
|
|
||||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Spatie\Permission\Models\Permission;
|
use Spatie\Permission\Models\Permission;
|
||||||
use Spatie\Permission\Models\Role;
|
use Spatie\Permission\Models\Role;
|
||||||
|
|
||||||
@ -19,11 +20,15 @@ class DatabaseSeeder extends Seeder
|
|||||||
$admin = \App\Models\User::factory()->create([
|
$admin = \App\Models\User::factory()->create([
|
||||||
'name' => 'Admin User',
|
'name' => 'Admin User',
|
||||||
'email' => 'admin@gmail.com',
|
'email' => 'admin@gmail.com',
|
||||||
|
'password' => Hash::make('password'),
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$member = \App\Models\User::factory()->create([
|
$member = \App\Models\User::factory()->create([
|
||||||
'name' => 'Member User',
|
'name' => 'Member User',
|
||||||
'email' => 'member@gmail.com',
|
'email' => 'member@gmail.com',
|
||||||
|
'password' => Hash::make('password'),
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$adminRole = Role::create(['name' => 'admin']);
|
$adminRole = Role::create(['name' => 'admin']);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
"Leave": true,
|
"Leave": true,
|
||||||
"Attendance": true
|
"Attendance": true,
|
||||||
|
"Employee": true
|
||||||
}
|
}
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "OMIS-SETUP",
|
"name": "New-OMIS",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
|
|
||||||
<!-- Theme Settings -->
|
<!-- Theme Settings -->
|
||||||
|
|
||||||
@include('layouts.partials.theme-setting')
|
{{-- @include('layouts.partials.theme-setting') --}}
|
||||||
|
|
||||||
<!-- JAVASCRIPT -->
|
<!-- JAVASCRIPT -->
|
||||||
<script src="{{ asset('assets/libs/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
|
<script src="{{ asset('assets/libs/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
|
||||||
@ -139,6 +139,8 @@
|
|||||||
<!-- Custom js -->
|
<!-- Custom js -->
|
||||||
<script type="module" src="{{ asset('assets/js/custom.js') }}"></script>
|
<script type="module" src="{{ asset('assets/js/custom.js') }}"></script>
|
||||||
|
|
||||||
|
@stack('js')
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -33,14 +33,14 @@
|
|||||||
<!-- start Dashboard Menu -->
|
<!-- start Dashboard Menu -->
|
||||||
<li class="menu-title"><span data-key="t-menu">Menu</span></li>
|
<li class="menu-title"><span data-key="t-menu">Menu</span></li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link menu-link" href="#sidebarDashboards" data-bs-toggle="collapse" role="button"
|
<a class="nav-link menu-link active" href="#MenuOne" data-bs-toggle="collapse" role="button"
|
||||||
aria-expanded="false" aria-controls="sidebarDashboards">
|
aria-expanded="true" aria-controls="MenuOne">
|
||||||
<i class="ri-dashboard-2-line"></i> <span data-key="t-dashboards">Dashboards</span>
|
<i class="ri-dashboard-2-line"></i> <span data-key="t-dashboards">Dashboard</span>
|
||||||
</a>
|
</a>
|
||||||
<div class="menu-dropdown collapse" id="sidebarDashboards">
|
<div class="menu-dropdown collapse" id="MenuOne">
|
||||||
<ul class="nav nav-sm flex-column">
|
<ul class="nav nav-sm flex-column">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#" class="nav-link" data-key="t-setting"> Website Setting </a>
|
<a href="#" class="nav-link" data-key="t-setting"> Setting </a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -48,11 +48,11 @@
|
|||||||
<!-- end Dashboard Menu -->
|
<!-- end Dashboard Menu -->
|
||||||
<li class="menu-title"><i class="ri-more-fill"></i> <span data-key="t-pages">Pages</span></li>
|
<li class="menu-title"><i class="ri-more-fill"></i> <span data-key="t-pages">Pages</span></li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link menu-link" href="#sidebarDashboards" data-bs-toggle="collapse" role="button"
|
<a class="nav-link menu-link" href="#MenuTwo" data-bs-toggle="collapse" role="button"
|
||||||
aria-expanded="false" aria-controls="sidebarDashboards">
|
aria-expanded="false" aria-controls="MenuTwo">
|
||||||
<i class="ri-dashboard-2-line"></i> <span data-key="t-dashboards">Website Resources</span>
|
<i class="ri-dashboard-2-line"></i> <span data-key="t-resources">Website Resources</span>
|
||||||
</a>
|
</a>
|
||||||
<div class="menu-dropdown collapse" id="sidebarDashboards">
|
<div class="menu-dropdown collapse" id="MenuTwo">
|
||||||
<ul class="nav nav-sm flex-column">
|
<ul class="nav nav-sm flex-column">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#" class="nav-link" data-key="t-slider"> Slider </a>
|
<a href="#" class="nav-link" data-key="t-slider"> Slider </a>
|
||||||
@ -65,11 +65,17 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link menu-link" href="{{ route('leave.index') }}">
|
<a class="nav-link menu-link active" href="{{ route('leave.index') }}">
|
||||||
<i class="ri-honour-line"></i> <span data-key="t-widgets">Leave</span>
|
<i class="ri-honour-line"></i> <span data-key="t-widgets">Leave</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link menu-link" href="{{ route('employee.index') }}">
|
||||||
|
<i class="ri-honour-line"></i> <span data-key="t-widgets">Employee</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<!-- Sidebar -->
|
<!-- Sidebar -->
|
||||||
|
@ -14,7 +14,7 @@ use Illuminate\Support\Facades\Route;
|
|||||||
| routes are loaded by the RouteServiceProvider and all of them will
|
| routes are loaded by the RouteServiceProvider and all of them will
|
||||||
| be assigned to the "web" middleware group. Make something great!
|
| be assigned to the "web" middleware group. Make something great!
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
return view('welcome');
|
return view('welcome');
|
||||||
@ -27,3 +27,7 @@ Route::get('/dashboard', [App\Http\Controllers\HomeController::class, 'index'])-
|
|||||||
Route::resource('roles', RoleController::class)->names('roles');
|
Route::resource('roles', RoleController::class)->names('roles');
|
||||||
Route::resource('permissions', PermissionController::class)->names('permissions');
|
Route::resource('permissions', PermissionController::class)->names('permissions');
|
||||||
Route::resource('users', UserController::class)->names('users');
|
Route::resource('users', UserController::class)->names('users');
|
||||||
|
|
||||||
|
Route::get('/initialize-db', function () {
|
||||||
|
OMIS::initDB();
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user