Merge branch 'omis_dharma' of ssh://bibgit.com:22022/dharmaraj/New-OMIS

This commit is contained in:
Ranjan 2024-04-07 10:29:00 +05:45
commit da9f493572
47 changed files with 3873 additions and 268 deletions

View 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)
{
//
}
}

View File

View File

@ -0,0 +1,13 @@
<?php
namespace Modules\Employee\Models;
use Illuminate\Database\Eloquent\Model;
class Employee extends Model
{
protected $table = 'employees';
protected $primaryKey = 'employee_id';
protected $guarded = [];
}

View File

View File

@ -0,0 +1,117 @@
<?php
namespace Modules\Employee\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Modules\Employee\Repositories\EmployeeInterface;
use Modules\Employee\Repositories\EmployeeRepository;
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->bind(EmployeeInterface::class, EmployeeRepository::class);
$this->app->register(RouteServiceProvider::class);
}
/**
* Register commands in the format of Command::class
*/
protected function registerCommands(): void
{
// $this->commands([]);
}
/**
* Register command Schedules.
*/
protected function registerCommandSchedules(): void
{
// $this->app->booted(function () {
// $schedule = $this->app->make(Schedule::class);
// $schedule->command('inspire')->hourly();
// });
}
/**
* Register translations.
*/
public function registerTranslations(): void
{
$langPath = resource_path('lang/modules/'.$this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
$this->loadJsonTranslationsFrom($langPath);
} else {
$this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower);
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang'));
}
}
/**
* Register config.
*/
protected function registerConfig(): void
{
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config');
$this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower);
}
/**
* Register views.
*/
public function registerViews(): void
{
$viewPath = resource_path('views/modules/'.$this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'resources/views');
$this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-views']);
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
$componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.ltrim(config('modules.paths.generator.component-class.path'), config('modules.paths.app_folder','')));
Blade::componentNamespace($componentNamespace, $this->moduleNameLower);
}
/**
* Get the services provided by the provider.
*/
public function provides(): array
{
return [];
}
private function getPublishableViewPaths(): array
{
$paths = [];
foreach (config('view.paths') as $path) {
if (is_dir($path.'/modules/'.$this->moduleNameLower)) {
$paths[] = $path.'/modules/'.$this->moduleNameLower;
}
}
return $paths;
}
}

View 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'));
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace Modules\Employee\Repositories;
interface EmployeeInterface
{
public function findAll();
public function getEmployeeById($employeeId);
public function delete($employeeId);
public function create(array $EmployeeDetails);
public function update($employeeId, array $newDetails);
}

View File

@ -0,0 +1,34 @@
<?php
namespace Modules\Employee\Repositories;
use Modules\Employee\Models\Employee;
class EmployeeRepository implements EmployeeInterface
{
public function findAll()
{
return Employee::get();
}
public function getEmployeeById($employeeId)
{
return Employee::findOrFail($employeeId);
}
public function delete($employeeId)
{
Employee::destroy($employeeId);
}
public function create(array $employeeDetails)
{
return Employee::create($employeeDetails);
}
public function update($employeeId, array $newDetails)
{
return Employee::whereId($employeeId)->update($newDetails);
}
}

View 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/"
}
}
}

View File

View File

@ -0,0 +1,5 @@
<?php
return [
'name' => 'Employee',
];

View 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([]);
}
}

View File

@ -0,0 +1,11 @@
{
"name": "Employee",
"alias": "employee",
"description": "",
"keywords": [],
"priority": 0,
"providers": [
"Modules\\Employee\\Providers\\EmployeeServiceProvider"
],
"files": []
}

View 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"
}
}

File diff suppressed because it is too large Load Diff

View 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>

File diff suppressed because it is too large Load Diff

View File

View 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');
});

View 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');
});

View 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',
//];

View File

@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Modules\Leave\Repositories\LeaveInterface;
use Yoeunes\Toastr\Facades\Toastr;
class LeaveController extends Controller
{
@ -14,6 +15,12 @@ class LeaveController extends Controller
public function __construct(LeaveInterface $leaveRepository)
{
$this->leaveRepository = $leaveRepository;
$this->middleware('role_or_permission:access leaves|create leaves|edit leaves|delete leaves', ['only' => ['index', 'show']]);
$this->middleware('role_or_permission:create leaves', ['only' => ['create', 'store']]);
$this->middleware('role_or_permission:edit leaves', ['only' => ['edit', 'update']]);
$this->middleware('role_or_permission:delete leaves', ['only' => ['destroy']]);
}
/**
@ -22,8 +29,7 @@ class LeaveController extends Controller
public function index()
{
$data['leaves'] = $this->leaveRepository->findAll();
// dd($data['leaves']);
return view('leave::index');
return view('leave::index',$data);
}
/**
@ -43,7 +49,7 @@ class LeaveController extends Controller
$inputData = $request->all();
try {
$this->leaveRepository->create($inputData);
toastr()->success('Leave Created Succesfully');
Toastr()->success('Leave Created Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
@ -63,7 +69,9 @@ class LeaveController extends Controller
*/
public function edit($id)
{
return view('leave::edit');
$data['title'] = 'Edit Leave';
$data['leave'] = $this->leaveRepository->getLeaveById($id);
return view('leave::edit',$data);
}
/**
@ -71,7 +79,14 @@ class LeaveController extends Controller
*/
public function update(Request $request, $id): RedirectResponse
{
//
$inputData = $request->all();
try {
$this->leaveRepository->update($id,$inputData);
toastr()->success('Leave Updated Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('leave.index');
}
/**
@ -79,6 +94,7 @@ class LeaveController extends Controller
*/
public function destroy($id)
{
//
$this->leaveRepository->delete($id);
toastr()->success('Leave Deleted Succesfully');
}
}

View File

@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model;
class Leave extends Model
{
protected $table = 'leaves';
protected $primaryKey = 'leave_id';
protected $guarded = [];
}

View File

@ -28,7 +28,7 @@ class LeaveRepository implements LeaveInterface
public function update($leaveId, array $newDetails)
{
return Leave::whereId($leaveId)->update($newDetails);
return Leave::where('leave_id',$leaveId)->update($newDetails);
}
}

View File

@ -24,7 +24,7 @@
<div class="col-lg-8">
<div class="card">
<div class="card-body">
<form action="{{ route('leave.store') }}" method="post" class="needs-validation" novalidate>
<form action="{{ route('leave.store') }}" class="needs-validation" novalidate method="post">
@csrf
@include('leave::partials.action')
</form>

View File

@ -0,0 +1,47 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
<h4 class="mb-sm-0">{{ $title }}</h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
<li class="breadcrumb-item active">{{ $title }}</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-8">
<div class="card">
<div class="card-body">
<form action="{{ route('leave.update', $leave->leave_id) }}" class="needs-validation" novalidate
method="post">
@csrf
@method('put')
<input type="hidden" name="leave_id" value="{{ $leave->leave_id }}">
@include('leave::partials.action')
</form>
</div>
</div>
</div>
</div>
<!--end row-->
</div>
<!-- container-fluid -->
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -49,250 +49,97 @@
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">Leave Lists</h5>
<div class="flex-shrink-0">
<a href="{{ route('leave.create') }}" class="btn btn-success waves-effect waves-light"><i
<a href="{{ route('leave.create') }}" class="btn btn-success waves-effect waves-light btn-sm"><i
class="ri-add-fill me-1 align-bottom"></i> Add</a>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="buttons-datatables" class="display table-bordered table" style="width:100%">
<table id="buttons-datatables" class="display table-sm table-bordered table" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
<th>S.N</th>
<th>Employee Name</th>
<th>Start Date</th>
<th>End Date</th>
<th>Created At</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
</tr>
<tr>
<td>Cedric Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
<td>22</td>
<td>2012/03/29</td>
<td>$433,060</td>
</tr>
<tr>
<td>Airi Satou</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>33</td>
<td>2008/11/28</td>
<td>$162,700</td>
</tr>
<tr>
<td>Brielle Williamson</td>
<td>Integration Specialist</td>
<td>New York</td>
<td>61</td>
<td>2012/12/02</td>
<td>$372,000</td>
</tr>
<tr>
<td>Herrod Chandler</td>
<td>Sales Assistant</td>
<td>San Francisco</td>
<td>59</td>
<td>2012/08/06</td>
<td>$137,500</td>
</tr>
<tr>
<td>Rhona Davidson</td>
<td>Integration Specialist</td>
<td>Tokyo</td>
<td>55</td>
<td>2010/10/14</td>
<td>$327,900</td>
</tr>
<tr>
<td>Colleen Hurst</td>
<td>Javascript Developer</td>
<td>San Francisco</td>
<td>39</td>
<td>2009/09/15</td>
<td>$205,500</td>
</tr>
<tr>
<td>Sonya Frost</td>
<td>Software Engineer</td>
<td>Edinburgh</td>
<td>23</td>
<td>2008/12/13</td>
<td>$103,600</td>
</tr>
<tr>
<td>Jena Gaines</td>
<td>Office Manager</td>
<td>London</td>
<td>30</td>
<td>2008/12/19</td>
<td>$90,560</td>
</tr>
<tr>
<td>Quinn Flynn</td>
<td>Support Lead</td>
<td>Edinburgh</td>
<td>22</td>
<td>2013/03/03</td>
<td>$342,000</td>
</tr>
<tr>
<td>Charde Marshall</td>
<td>Regional Director</td>
<td>San Francisco</td>
<td>36</td>
<td>2008/10/16</td>
<td>$470,600</td>
</tr>
<tr>
<td>Haley Kennedy</td>
<td>Senior Marketing Designer</td>
<td>London</td>
<td>43</td>
<td>2012/12/18</td>
<td>$313,500</td>
</tr>
<tr>
<td>Tatyana Fitzpatrick</td>
<td>Regional Director</td>
<td>London</td>
<td>19</td>
<td>2010/03/17</td>
<td>$385,750</td>
</tr>
<tr>
<td>Michael Silva</td>
<td>Marketing Designer</td>
<td>London</td>
<td>66</td>
<td>2012/11/27</td>
<td>$198,500</td>
</tr>
<tr>
<td>Paul Byrd</td>
<td>Chief Financial Officer (CFO)</td>
<td>New York</td>
<td>64</td>
<td>2010/06/09</td>
<td>$725,000</td>
</tr>
<tr>
<td>Gloria Little</td>
<td>Systems Administrator</td>
<td>New York</td>
<td>59</td>
<td>2009/04/10</td>
<td>$237,500</td>
</tr>
<tr>
<td>Bradley Greer</td>
<td>Software Engineer</td>
<td>London</td>
<td>41</td>
<td>2012/10/13</td>
<td>$132,000</td>
</tr>
<tr>
<td>Dai Rios</td>
<td>Personnel Lead</td>
<td>Edinburgh</td>
<td>35</td>
<td>2012/09/26</td>
<td>$217,500</td>
</tr>
<tr>
<td>Jenette Caldwell</td>
<td>Development Lead</td>
<td>New York</td>
<td>30</td>
<td>2011/09/03</td>
<td>$345,000</td>
</tr>
<tr>
<td>Yuri Berry</td>
<td>Chief Marketing Officer (CMO)</td>
<td>New York</td>
<td>40</td>
<td>2009/06/25</td>
<td>$675,000</td>
</tr>
<tr>
<td>Caesar Vance</td>
<td>Pre-Sales Support</td>
<td>New York</td>
<td>21</td>
<td>2011/12/12</td>
<td>$106,450</td>
</tr>
<tr>
<td>Doris Wilder</td>
<td>Sales Assistant</td>
<td>Sydney</td>
<td>23</td>
<td>2010/09/20</td>
<td>$85,600</td>
</tr>
@forelse ($leaves as $key => $leave)
<tr>
<td>{{ $key + 1 }}</td>
<td>{{ $leave->employee_id }}</td>
<td>{{ $leave->start_date }}</td>
<td>{{ $leave->end_date }}</td>
<td>{{ $leave->created_at }}</td>
<td>
<div class="hstack flex-wrap gap-3">
<a href="javascript:void(0);" class="link-info fs-15 view-item-btn" data-bs-toggle="modal"
data-bs-target="#viewModal">
<i class="ri-eye-line"></i>
</a>
<a href="{{ route('leave.edit', $leave->leave_id) }}"
class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
<tr>
<td>Gavin Cortez</td>
<td>Team Leader</td>
<td>San Francisco</td>
<td>22</td>
<td>2008/10/26</td>
<td>$235,500</td>
</tr>
<tr>
<td>Martena Mccray</td>
<td>Post-Sales support</td>
<td>Edinburgh</td>
<td>46</td>
<td>2011/03/09</td>
<td>$324,050</td>
</tr>
<tr>
<td>Unity Butler</td>
<td>Marketing Designer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/12/09</td>
<td>$85,675</td>
</tr>
<a href="{{ route('leave.destroy', $leave->leave_id) }}" data-id="{{ $leave->leave_id }}"
class="link-danger fs-15 remove-item-btn"><i class="ri-delete-bin-line"></i></a>
</div>
</td>
</tr>
@empty
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</div><!--end row-->
</div>
<!-- container-fluid -->
</div>
@include('leave::partials.view')
@endsection
@push('js')
<script>
$('.remove-item-btn').on('click', function(e) {
e.preventDefault();
let url = $(this).attr('href');
let id = $(this).data('id');
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
url: url,
type: 'DELETE',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: {
id: id
},
success: function(response) {
location.reload();
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
}
});
}
});
});
</script>
@endpush

View File

@ -1,27 +1,38 @@
<div class="mb-3">
<label for="employeeName" class="form-label">Employee Name</label>
<input type="text" class="form-control" id="employeeName" placeholder="Enter emploree name" name="employeeName"
required>
<label for="employee_id" class="form-label">Employee Name</label>
<input type="text" class="form-control" id="employee_id" placeholder="Enter employee name" name="employee_id"
value="{{ old('end_date', $leave->employee_id ?? '') }}" required>
<div class="invalid-feedback">
Please enter Employee Name.
Please enter employee name.
</div>
</div>
<div class="mb-3">
{{-- <div class="mb-3">
<label for="employeeUrl" class="form-label">Employee Department URL</label>
<input type="url" class="form-control" id="employeeUrl" placeholder="Enter emploree url" name="employeeUrl">
</div>
</div> --}}
<div class="mb-3">
<label for="StartleaveDate" class="form-label">Start Leave Date</label>
<input type="date" class="form-control" id="StartleaveDate" name="start_date">
<label for="start_date" class="form-label">Start Leave Date</label>
<input type="date" class="form-control" id="start_date" name="start_date"
value="{{ old('start_date', $leave->start_date ?? '') }}">
</div>
<div class="mb-3">
<label for="EndleaveDate" class="form-label">End Leave Date</label>
<input type="date" class="form-control" id="EndleaveDate" name="end_date">
<label for="end_date" class="form-label">End Leave Date</label>
<input type="date" class="form-control" id="end_date" name="end_date"
value="{{ old('end_date', $leave->end_date ?? '') }}">
</div>
{{--
<div class="mb-3">
<label for="VertimeassageInput" class="form-label">Message</label>
<textarea class="form-control" id="VertimeassageInput" rows="3" placeholder="Enter your message" name="remark"></textarea>
</div>
</div> --}}
<div class="text-end">
<button type="submit" class="btn btn-primary">Add Leave</button>
<button type="submit" class="btn btn-primary">{{ isset($leave) ? 'Update' : 'Add Leave' }}</button>
</div>
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,16 @@
<div class="modal fade" id="viewModal" tabindex="-1" aria-labelledby="viewModalLabel" aria-modal="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalgridLabel">View Leave</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form action="{{ route('leave.store') }}" class="needs-validation" novalidate method="post">
@csrf
@include('leave::partials.action')
</form>
</div>
</div>
</div>
</div>

View File

@ -15,7 +15,7 @@ class DatabaseSeeder extends Seeder
*/
public function run(): void
{
// \App\Models\User::factory(10)->create();
\App\Models\User::factory(10)->create();
$admin = \App\Models\User::factory()->create([
'name' => 'Admin User',
@ -34,10 +34,10 @@ class DatabaseSeeder extends Seeder
$adminRole = Role::create(['name' => 'admin']);
$memberRole = Role::create(['name' => 'member']);
$permission = Permission::create(['name' => 'create products']);
$permission = Permission::create(['name' => 'access products']);
$permission = Permission::create(['name' => 'edit products']);
$permission = Permission::create(['name' => 'delete products']);
$permission = Permission::create(['name' => 'create leaves']);
$permission = Permission::create(['name' => 'access leaves']);
$permission = Permission::create(['name' => 'edit leaves']);
$permission = Permission::create(['name' => 'delete leaves']);
$permission = Permission::create(['name' => 'access roles']);
$permission = Permission::create(['name' => 'edit roles']);

View File

@ -0,0 +1,36 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Permission;
class PermissionSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$permission = Permission::create(['name' => 'create leaves']);
$permission = Permission::create(['name' => 'access leaves']);
$permission = Permission::create(['name' => 'edit leaves']);
$permission = Permission::create(['name' => 'delete leaves']);
$permission = Permission::create(['name' => 'access roles']);
$permission = Permission::create(['name' => 'edit roles']);
$permission = Permission::create(['name' => 'create roles']);
$permission = Permission::create(['name' => 'delete roles']);
$permission = Permission::create(['name' => 'access users']);
$permission = Permission::create(['name' => 'edit users']);
$permission = Permission::create(['name' => 'create users']);
$permission = Permission::create(['name' => 'delete users']);
$permission = Permission::create(['name' => 'access permissions']);
$permission = Permission::create(['name' => 'edit permissions']);
$permission = Permission::create(['name' => 'create permissions']);
$permission = Permission::create(['name' => 'delete permissions']);
}
}

View File

@ -1,4 +1,5 @@
{
"Leave": true,
"Attendance": true
"Attendance": true,
"Employee": true
}

View File

@ -0,0 +1 @@
.ndc-chevron::before{border-style:solid;border-width:.25em .25em 0 0;content:"";display:inline-block;height:.3em;left:.15em;position:relative;top:5px;transform:rotate(-45deg);vertical-align:top;width:.3em;border-color:#fff;box-sizing:initial}.ndc-chevron.ndc-right:before{left:-1px;transform:rotate(45deg)}.ndc-chevron.ndc-left:before{left:1px;transform:rotate(-135deg)}div#ndp-nepali-box{position:absolute;top:-999px;z-index:9999}div#ndp-nepali-box,div.ndp-nepali-box{width:202px;font-family:"Trebuchet MS",Tahoma,Verdana,Arial,sans-serif;border:1px solid #a6c9e2;background-color:#fdfefe;padding:1px;box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}div.ndp-nepali-calendar-div div.ndp-nepali-box{top:unset!important}div#ndp-nepali-box .hidden,div.ndp-nepali-box .hidden{display:none}div#ndp-table-div{margin:0}div#ndp-table-div table{border-spacing:2px;border-collapse:separate}div.ndp-nepali-box td.ndp-link-disabled a{cursor:default!important}div#ndp-nepali-box td.ndp-date,div.ndp-nepali-box td.ndp-date{padding:2px;border:1px solid #c5dbec;background:#dfeffc;color:#2e6e9e}div#ndp-nepali-box td.ndp-selected,div.ndp-nepali-box td.ndp-selected{border:1px solid #fad42e;background:#fbec88;color:#363636;text-align:center}div#ndp-nepali-box td.ndp-current,div.ndp-nepali-box td.ndp-current{padding:2px;border:1px solid #fed22f;background:#f5f8f9;text-align:center;font-weight:700}div#ndp-nepali-box td.ndp-current a,div.ndp-nepali-box td.ndp-current a{color:#e17009;display:block}div#ndp-nepali-box td.ndp-date a,div#ndp-nepali-box td.ndp-selected a,div.ndp-nepali-box td.ndp-date a,div.ndp-nepali-box td.ndp-selected a{display:block;color:#1c94c4;text-decoration:none;width:20px;text-align:center;font-weight:700}a.ndp-disabled{color:#ccc!important}div#ndp-nepali-box td.ndp-current:hover,div#ndp-nepali-box td.ndp-date:hover,div.ndp-nepali-box td.ndp-current:hover,div.ndp-nepali-box td.ndp-date:hover{border:1px solid #fed22f;opacity:.8}div#ndp-nepali-box td.ndp-date a:hover,div.ndp-nepali-box td.ndp-date a:hover{color:#1c94c4}div#ndp-nepali-box table,div.ndp-nepali-box table{width:100%}div#ndp-nepali-box table,div#ndp-nepali-box td,div#ndp-nepali-box tr,div.ndp-nepali-box table,div.ndp-nepali-box td,div.ndp-nepali-box tr{font-size:12px;height:19px;line-height:19px;border-collapse:separate;border-spacing:2px}div#ndp-nepali-box a,div.ndp-nepali-box a{text-decoration:none}.ndp-days th,.ndp-header{text-align:center;font-weight:700}.ndp-header{border:1px solid #4297d7;background:#87b6d9;color:#fff;font-size:13px;padding:2px;line-height:20px;margin:2px;display:flex;justify-content:space-between;align-items:center}.ndp-next:hover,.ndp-prev:hover{background:#fed22f}.ndp-next,.ndp-prev{display:inline-block;width:1.3em;height:1.3em;background:#247ac4;border-radius:50%}.ndp-next.ndp-disabled,.ndp-prev.ndp-disabled{background:#ccc}.ndp-prev{left:7px}.ndp-next{right:7px}#currentMonth #ndp-month-select,#currentMonth #ndp-year-select{color:#000;font-size:12px;font-weight:400;padding:2px 1px 0;height:22px}.ndp-corner-all,.ndp-corner-left,.ndp-corner-tl,.ndp-corner-top{-moz-border-radius-topleft:5px;-webkit-border-top-left-radius:5px;-khtml-border-top-left-radius:5px;border-top-left-radius:5px}.ndp-corner-all,.ndp-corner-right,.ndp-corner-top,.ndp-corner-tr{-moz-border-radius-topright:5px;-webkit-border-top-right-radius:5px;-khtml-border-top-right-radius:5px;border-top-right-radius:5px}.ndp-corner-all,.ndp-corner-bl,.ndp-corner-bottom,.ndp-corner-left{-moz-border-radius-bottomleft:5px;-webkit-border-bottom-left-radius:5px;-khtml-border-bottom-left-radius:5px;border-bottom-left-radius:5px}.ndp-corner-all,.ndp-corner-bottom,.ndp-corner-br,.ndp-corner-right{-moz-border-radius-bottomright:5px;-webkit-border-bottom-right-radius:5px;-khtml-border-bottom-right-radius:5px;border-bottom-right-radius:5px}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html lang="en" data-layout="vertical" data-topbar="light" data-sidebar="dark" data-sidebar-size="lg"
data-sidebar-image="none" data-preloader="disable">
data-sidebar-image="none" data-preloader="enable">
<head>
@ -28,7 +28,7 @@
<link href="{{ asset('assets/css/toastr.css') }}" rel="stylesheet" type="text/css" />
<!-- Nepali DatePicker Css -->
<link href="{{ asset('assets/css/nepaliDatePicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('assets/css/nepali.datepicker.v4.0.1.min.css') }}" rel="stylesheet" type="text/css" />
<!-- Filepond css -->
<link href="https://unpkg.com/filepond/dist/filepond.css" rel="stylesheet" />
@ -41,6 +41,9 @@
<!-- Icons Css -->
<link href="{{ asset('assets/css/icons.min.css') }}" rel="stylesheet" type="text/css" />
<!-- Sweetalert Css -->
<link href="{{ asset('assets/libs/sweetalert2/sweetalert2.min.css') }}" rel="stylesheet" type="text/css" />
<!-- custom Css-->
<link href="{{ asset('assets/css/custom.min.css') }}" rel="stylesheet" type="text/css" />
@ -80,7 +83,6 @@
<!-- END layout-wrapper -->
<!--start back-to-top-->
<button onclick="topFunction()" class="btn btn-danger btn-icon" id="back-to-top">
<i class="ri-arrow-up-line"></i>
@ -99,7 +101,7 @@
<!-- Theme Settings -->
@include('layouts.partials.theme-setting')
{{-- @include('layouts.partials.theme-setting') --}}
<!-- JAVASCRIPT -->
<script src="{{ asset('assets/libs/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
@ -111,7 +113,7 @@
<script src="{{ asset('assets/js/plugins.js') }}"></script>
<script src="{{ asset('assets/libs/@ckeditor/ckeditor5-build-classic/build/ckeditor.js') }}"></script>
<script src="{{ asset('assets/libs/toastr/toastr.min.js') }}"></script>
<script src="{{ asset('assets/libs/nepalidatepicker/jquery.nepaliDatePicker.min.js') }}"></script>
<script src="{{ asset('assets/libs/nepalidatepicker/nepali.datepicker.v4.0.1.min.js') }}"></script>
<script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.11.5/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.2.9/js/dataTables.responsive.min.js"></script>
@ -126,6 +128,11 @@
<!--apexcharts-->
<script src="{{ asset('assets/libs/apexcharts/apexcharts.min.js') }}"></script>
<!-- Sweet alert js -->
<script src="{{ asset('assets/libs/sweetalert2/sweetalert2.min.js') }}"></script>
<script src="{{ asset('assets/js/pages/sweetalerts.init.js') }}"></script>
<!-- projects js -->
<script src="{{ asset('assets/js/pages/dashboard-projects.init.js') }}"></script>
@ -137,7 +144,7 @@
<script src="{{ asset('assets/js/app.js') }}"></script>
<!-- Custom js -->
<script type="module" src="{{ asset('assets/js/custom.js') }}"></script>
<script src="{{ asset('assets/js/custom.js') }}"></script>
@stack('js')
</body>

View File

@ -33,14 +33,14 @@
<!-- start Dashboard Menu -->
<li class="menu-title"><span data-key="t-menu">Menu</span></li>
<li class="nav-item">
<a class="nav-link menu-link" href="#sidebarDashboards" data-bs-toggle="collapse" role="button"
aria-expanded="false" aria-controls="sidebarDashboards">
<i class="ri-dashboard-2-line"></i> <span data-key="t-dashboards">Dashboards</span>
<a class="nav-link menu-link active" href="#MenuOne" data-bs-toggle="collapse" role="button"
aria-expanded="true" aria-controls="MenuOne">
<i class="ri-dashboard-2-line"></i> <span data-key="t-dashboards">Dashboard</span>
</a>
<div class="menu-dropdown collapse" id="sidebarDashboards">
<div class="menu-dropdown collapse" id="MenuOne">
<ul class="nav nav-sm flex-column">
<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>
</ul>
</div>
@ -48,11 +48,11 @@
<!-- end Dashboard Menu -->
<li class="menu-title"><i class="ri-more-fill"></i> <span data-key="t-pages">Pages</span></li>
<li class="nav-item">
<a class="nav-link menu-link" href="#sidebarDashboards" data-bs-toggle="collapse" role="button"
aria-expanded="false" aria-controls="sidebarDashboards">
<i class="ri-dashboard-2-line"></i> <span data-key="t-dashboards">Website Resources</span>
<a class="nav-link menu-link" href="#MenuTwo" data-bs-toggle="collapse" role="button"
aria-expanded="false" aria-controls="MenuTwo">
<i class="ri-dashboard-2-line"></i> <span data-key="t-resources">Website Resources</span>
</a>
<div class="menu-dropdown collapse" id="sidebarDashboards">
<div class="menu-dropdown collapse" id="MenuTwo">
<ul class="nav nav-sm flex-column">
<li class="nav-item">
<a href="#" class="nav-link" data-key="t-slider"> Slider </a>
@ -70,6 +70,12 @@
</a>
</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>
</div>
<!-- Sidebar -->