leave user employee module setup

This commit is contained in:
2024-04-07 13:13:58 +05:45
parent da9f493572
commit cfd2147536
174 changed files with 9312 additions and 9540 deletions

View File

@ -0,0 +1,67 @@
<?php
namespace Modules\Attendance\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class AttendanceController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('attendance::index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('attendance::create');
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
//
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('attendance::show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('attendance::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,114 @@
<?php
namespace Modules\Attendance\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class AttendanceServiceProvider extends ServiceProvider
{
protected string $moduleName = 'Attendance';
protected string $moduleNameLower = 'attendance';
/**
* 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;
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace Modules\Attendance\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('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'));
}
}

View File

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

View File

View File

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

View File

@ -0,0 +1,16 @@
<?php
namespace Modules\Attendance\database\seeders;
use Illuminate\Database\Seeder;
class AttendanceDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// $this->call([]);
}
}

View File

@ -0,0 +1,11 @@
{
"name": "Attendance",
"alias": "attendance",
"description": "",
"keywords": [],
"priority": 0,
"providers": [
"Modules\\Attendance\\Providers\\AttendanceServiceProvider"
],
"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"
}
}

View File

@ -0,0 +1,7 @@
@extends('attendance::layouts.master')
@section('content')
<h1>Hello World</h1>
<p>Module: {!! config('attendance.name') !!}</p>
@endsection

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>Attendance 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-attendance', 'resources/assets/sass/app.scss') }} --}}
</head>
<body>
@yield('content')
{{-- Vite JS --}}
{{-- {{ module_vite('build-attendance', 'resources/assets/js/app.js') }} --}}
</body>

View File

View File

@ -0,0 +1,19 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\Attendance\Http\Controllers\AttendanceController;
/*
*--------------------------------------------------------------------------
* 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('attendance', AttendanceController::class)->names('attendance');
});

View File

@ -0,0 +1,19 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\Attendance\Http\Controllers\AttendanceController;
/*
|--------------------------------------------------------------------------
| 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('attendance', AttendanceController::class)->names('attendance');
});

View File

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

View File

@ -1,13 +0,0 @@
<?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

@ -4,8 +4,6 @@ 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
{
@ -31,7 +29,6 @@ class EmployeeServiceProvider extends ServiceProvider
*/
public function register(): void
{
$this->app->bind(EmployeeInterface::class, EmployeeRepository::class);
$this->app->register(RouteServiceProvider::class);
}

View File

@ -1,12 +0,0 @@
<?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

@ -1,34 +0,0 @@
<?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

@ -5,21 +5,8 @@
<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">Team</h4>
@include('layouts.partials.breadcrumb', ['title' => 'Employee'])
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Pages</a></li>
<li class="breadcrumb-item active">Team</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<div class="card">
@ -37,7 +24,7 @@
<div class="list-grid-nav hstack gap-1">
<button class="btn btn-success addMembers-modal" data-bs-toggle="modal"
data-bs-target="#addmemberModal"><i class="ri-add-fill me-1 align-bottom"></i> Add Members</button>
data-bs-target="#addmemberModal"><i class="ri-add-fill me-1 align-bottom"></i> Create Employee</button>
</div>
</div>
@ -53,6 +40,7 @@
<div id="teamlist">
<div class="team-list row grid-view-filter" id="team-member-list">
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-9.jpg" alt="" class="img-fluid">
@ -112,6 +100,7 @@
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-12.jpg" alt="" class="img-fluid">
@ -172,6 +161,7 @@
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-11.jpg" alt=""
@ -231,809 +221,13 @@
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-1.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn active"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="9"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="9"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0"><img
src="assets/images/users/avatar-8.jpg" alt=""
class="member-img img-fluid d-block rounded-circle"></div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Jennifer Carter</h5>
</a>
<p class="text-muted member-designation mb-0">UI/UX Designer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">241</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">204</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-10.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="8"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="8"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0">
<div class="avatar-title bg-light text-primary rounded-circle text-uppercase border">ME
</div>
</div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Megan Elmore</h5>
</a>
<p class="text-muted member-designation mb-0">Team Leader &amp; Web Developer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">201</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">263</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-2.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="7"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="7"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0"><img
src="assets/images/users/avatar-4.jpg" alt=""
class="member-img img-fluid d-block rounded-circle"></div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Alexis Clarke</h5>
</a>
<p class="text-muted member-designation mb-0">Backend Developer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">132</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">147</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-4.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn active"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="6"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="6"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0">
<div class="avatar-title bg-light text-primary rounded-circle text-uppercase border">NC
</div>
</div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Nathan Cole</h5>
</a>
<p class="text-muted member-designation mb-0">Front-End Developer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">352</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">376</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-7.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn active"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="5"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="5"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0"><img
src="assets/images/users/avatar-6.jpg" alt=""
class="member-img img-fluid d-block rounded-circle"></div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Joseph Parker</h5>
</a>
<p class="text-muted member-designation mb-0">Full Stack Developer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">64</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">93</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-3.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="4"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="4"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0"><img
src="assets/images/users/avatar-5.jpg" alt=""
class="member-img img-fluid d-block rounded-circle"></div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Erica Kernan</h5>
</a>
<p class="text-muted member-designation mb-0">Web Designer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">345</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">298</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-5.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn active"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="3"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="3"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0">
<div class="avatar-title bg-light text-primary rounded-circle text-uppercase border">DP
</div>
</div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Donald Palmer</h5>
</a>
<p class="text-muted member-designation mb-0">Wed Developer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">97</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">135</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-8.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="2"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="2"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0"><img
src="assets/images/users/avatar-7.jpg" alt=""
class="member-img img-fluid d-block rounded-circle"></div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Jack Gough</h5>
</a>
<p class="text-muted member-designation mb-0">React Js Developer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">87</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">121</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="{{ route('employee.show', 1) }}"
class="btn btn-light view-btn">View Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-6.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="1"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="1"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0">
<div class="avatar-title bg-light text-primary rounded-circle text-uppercase border">MW
</div>
</div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Marie Ward</h5>
</a>
<p class="text-muted member-designation mb-0">Backend Developer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">145</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">210</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="mb-3 text-center">
<a href="javascript:void(0);" class="text-success"><i
class="mdi mdi-loading mdi-spin fs-20 me-2 align-middle"></i> Load More </a>
</div>
</div>
<div class="mt-4 py-4 text-center" id="noresult" style="display: none;">
<lord-icon src="https://cdn.lordicon.com/msoeawqm.json" trigger="loop"
colors="primary:#405189,secondary:#0ab39c" style="width:72px;height:72px"></lord-icon>
<h5 class="mt-4">Sorry! No Result Found</h5>
</div>
<!-- Modal -->
<div class="modal fade" id="addmemberModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content border-0">
<div class="modal-body">
<form autocomplete="off" id="memberlist-form" class="needs-validation" novalidate="">
<div class="row">
<div class="col-lg-12">
<input type="hidden" id="memberid-input" class="form-control" value="">
<div class="px-1 pt-1">
<div class="modal-team-cover position-relative mt-n4 mx-n4 rounded-top mb-0 overflow-hidden">
<img src="assets/images/small/img-9.jpg" alt="" id="cover-img"
class="img-fluid">
<div class="d-flex position-absolute end-0 start-0 top-0 p-3">
<div class="flex-grow-1">
<h5 class="modal-title text-white" id="createMemberLabel">Add New Members</h5>
</div>
<div class="flex-shrink-0">
<div class="d-flex align-items-center gap-3">
<div>
<label for="cover-image-input" class="mb-0" data-bs-toggle="tooltip"
data-bs-placement="top" aria-label="Select Cover Image"
data-bs-original-title="Select Cover Image">
<div class="avatar-xs">
<div
class="avatar-title bg-light rounded-circle text-muted cursor-pointer border">
<i class="ri-image-fill"></i>
</div>
</div>
</label>
<input class="form-control d-none" value="" id="cover-image-input"
type="file" accept="image/png, image/gif, image/jpeg">
</div>
<button type="button" class="btn-close btn-close-white" id="createMemberBtn-close"
data-bs-dismiss="modal" aria-label="Close"></button>
</div>
</div>
</div>
</div>
</div>
<div class="mt-n5 mb-4 pt-2 text-center">
<div class="position-relative d-inline-block">
<div class="position-absolute bottom-0 end-0">
<label for="member-image-input" class="mb-0" data-bs-toggle="tooltip"
data-bs-placement="right" aria-label="Select Member Image"
data-bs-original-title="Select Member Image">
<div class="avatar-xs">
<div class="avatar-title bg-light rounded-circle text-muted cursor-pointer border">
<i class="ri-image-fill"></i>
</div>
</div>
</label>
<input class="form-control d-none" value="" id="member-image-input"
type="file" accept="image/png, image/gif, image/jpeg">
</div>
<div class="avatar-lg">
<div class="avatar-title bg-light rounded-circle">
<img src="assets/images/users/user-dummy-img.jpg" id="member-img"
class="avatar-md rounded-circle h-auto">
</div>
</div>
</div>
</div>
<div class="mb-3">
<label for="teammembersName" class="form-label">Name</label>
<input type="text" class="form-control" id="teammembersName" placeholder="Enter name"
required="">
<div class="invalid-feedback">Please Enter a member name.</div>
</div>
<div class="mb-4">
<label for="designation" class="form-label">Designation</label>
<input type="text" class="form-control" id="designation"
placeholder="Enter designation" required="">
<div class="invalid-feedback">Please Enter a designation.</div>
</div>
<input type="hidden" id="project-input" class="form-control" value="">
<input type="hidden" id="task-input" class="form-control" value="">
<div class="hstack justify-content-end gap-2">
<button type="button" class="btn btn-light" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-success" id="addNewMember">Add Member</button>
</div>
</div>
</div>
</form>
</div>
</div>
<!--end modal-content-->
</div>
<!--end modal-dialog-->
</div>
<!--end modal-->
<div class="offcanvas offcanvas-end border-0" tabindex="-1" id="member-overview">
<!--end offcanvas-header-->
<div class="offcanvas-body profile-offcanvas p-0">
<div class="team-cover">
<img src="assets/images/small/img-9.jpg" alt="" class="img-fluid">
</div>
<div class="p-3">
<div class="team-settings">
<div class="row">
<div class="col">
<button type="button" class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn"> <i
class="ri-star-fill fs-14"></i> </button>
</div>
<div class="col dropdown text-end">
<a href="javascript:void(0);" id="dropdownMenuLink14" data-bs-toggle="dropdown"
aria-expanded="false">
<i class="ri-more-fill fs-17"></i>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="dropdownMenuLink14">
<li><a class="dropdown-item" href="javascript:void(0);"><i
class="ri-star-line me-2 align-middle"></i>Favorites</a></li>
<li><a class="dropdown-item" href="javascript:void(0);"><i
class="ri-delete-bin-5-line me-2 align-middle"></i>Delete</a></li>
</ul>
</div>
</div>
</div>
<!--end col-->
</div>
<div class="p-3 text-center">
<img src="assets/images/users/avatar-2.jpg" alt=""
class="avatar-lg img-thumbnail rounded-circle profile-img mx-auto">
<div class="mt-3">
<h5 class="fs-15 profile-name">Nancy Martino</h5>
<p class="text-muted profile-designation">Team Leader &amp; HR</p>
</div>
<div class="hstack justify-content-center mt-4 gap-2">
<div class="avatar-xs">
<a href="javascript:void(0);"
class="avatar-title bg-secondary-subtle text-secondary fs-16 rounded">
<i class="ri-facebook-fill"></i>
</a>
</div>
<div class="avatar-xs">
<a href="javascript:void(0);" class="avatar-title bg-success-subtle text-success fs-16 rounded">
<i class="ri-slack-fill"></i>
</a>
</div>
<div class="avatar-xs">
<a href="javascript:void(0);" class="avatar-title bg-info-subtle text-info fs-16 rounded">
<i class="ri-linkedin-fill"></i>
</a>
</div>
<div class="avatar-xs">
<a href="javascript:void(0);" class="avatar-title bg-danger-subtle text-danger fs-16 rounded">
<i class="ri-dribbble-fill"></i>
</a>
</div>
</div>
</div>
<div class="row g-0 text-center">
<div class="col-6">
<div class="border-start-0 border border-dashed p-3">
<h5 class="profile-project mb-1">124</h5>
<p class="text-muted mb-0">Projects</p>
</div>
</div>
<!--end col-->
<div class="col-6">
<div class="border-start-0 border border-dashed p-3">
<h5 class="profile-task mb-1">81</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
<!--end col-->
</div>
<!--end row-->
<div class="p-3">
<h5 class="fs-15 mb-3">Personal Details</h5>
<div class="mb-3">
<p class="text-muted text-uppercase fw-semibold fs-12 mb-2">Number</p>
<h6>+(256) 2451 8974</h6>
</div>
<div class="mb-3">
<p class="text-muted text-uppercase fw-semibold fs-12 mb-2">Email</p>
<h6>nancymartino@email.com</h6>
</div>
<div>
<p class="text-muted text-uppercase fw-semibold fs-12 mb-2">Location</p>
<h6 class="mb-0">Carson City - USA</h6>
</div>
</div>
<div class="border-top p-3">
<h5 class="fs-15 mb-4">File Manager</h5>
<div class="d-flex mb-3">
<div class="avatar-xs flex-shrink-0">
<div class="avatar-title bg-danger-subtle text-danger fs-16 rounded">
<i class="ri-image-2-line"></i>
</div>
</div>
<div class="flex-grow-1 ms-3">
<h6 class="mb-1"><a href="javascript:void(0);">Images</a></h6>
<p class="text-muted mb-0">4469 Files</p>
</div>
<div class="text-muted">
12 GB
</div>
</div>
<div class="d-flex mb-3">
<div class="avatar-xs flex-shrink-0">
<div class="avatar-title bg-secondary-subtle text-secondary fs-16 rounded">
<i class="ri-file-zip-line"></i>
</div>
</div>
<div class="flex-grow-1 ms-3">
<h6 class="mb-1"><a href="javascript:void(0);">Documents</a></h6>
<p class="text-muted mb-0">46 Files</p>
</div>
<div class="text-muted">
3.46 GB
</div>
</div>
<div class="d-flex mb-3">
<div class="avatar-xs flex-shrink-0">
<div class="avatar-title bg-success-subtle text-success fs-16 rounded">
<i class="ri-live-line"></i>
</div>
</div>
<div class="flex-grow-1 ms-3">
<h6 class="mb-1"><a href="javascript:void(0);">Media</a></h6>
<p class="text-muted mb-0">124 Files</p>
</div>
<div class="text-muted">
4.3 GB
</div>
</div>
<div class="d-flex">
<div class="avatar-xs flex-shrink-0">
<div class="avatar-title bg-primary-subtle text-primary fs-16 rounded">
<i class="ri-error-warning-line"></i>
</div>
</div>
<div class="flex-grow-1 ms-3">
<h6 class="mb-1"><a href="javascript:void(0);">Others</a></h6>
<p class="text-muted mb-0">18 Files</p>
</div>
<div class="text-muted">
846 MB
</div>
</div>
</div>
</div>
<!--end offcanvas-body-->
<div class="offcanvas-foorter hstack position-relative gap-3 border p-3 text-center">
<button class="btn btn-light w-100"><i class="ri-question-answer-fill ms-1 align-bottom"></i> Send
Message</button>
<a href="pages-profile.html" class="btn btn-primary w-100"><i
class="ri-user-3-fill ms-1 align-bottom"></i> View Profile</a>
</div>
</div>
<!--end offcanvas-->
</div>
</div><!-- end col -->
</div>

View File

@ -4,21 +4,7 @@
<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>
@include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title -->
<div class="row">
<div class="col-lg-8">

View File

@ -84,8 +84,9 @@
<a href="{{ route('leave.edit', $leave->leave_id) }}"
class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
<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>
<a href="javascript:void(0);" data-link="{{ 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>
@ -98,48 +99,10 @@
</div>
</div>
</div>
</div><!--end row-->
</div>
<!--end row-->
</div>
<!-- container-fluid -->
</div>
<!-- container-fluid -->
@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

@ -0,0 +1,72 @@
<?php
namespace Modules\User\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Models\User;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
class UserController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$data = User::latest()->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)
{
//
}
}

View File

View File

View File

View File

@ -0,0 +1,49 @@
<?php
namespace Modules\User\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('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'));
}
}

View File

@ -0,0 +1,114 @@
<?php
namespace Modules\User\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class UserServiceProvider extends ServiceProvider
{
protected string $moduleName = 'User';
protected string $moduleNameLower = 'user';
/**
* 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;
}
}

View File

View File

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

View File

View File

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

View File

View File

View File

@ -0,0 +1,16 @@
<?php
namespace Modules\User\database\seeders;
use Illuminate\Database\Seeder;
class UserDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// $this->call([]);
}
}

11
Modules/User/module.json Normal file
View File

@ -0,0 +1,11 @@
{
"name": "User",
"alias": "user",
"description": "",
"keywords": [],
"priority": 0,
"providers": [
"Modules\\User\\Providers\\UserServiceProvider"
],
"files": []
}

15
Modules/User/package.json Normal file
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"
}
}

View File

View File

View File

View File

@ -0,0 +1,44 @@
@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('user.store') }}" class="needs-validation" novalidate method="post">
@csrf
@include('user::partials.action', ['btnType' => 'Save'])
</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

@ -0,0 +1,44 @@
@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('user.store') }}" class="needs-validation" novalidate method="post">
@csrf
@include('user::partials.action', ['btnType' => 'Save'])
</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

@ -0,0 +1,73 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h4>{{ label('Users List') }}</h4>
<a href="{{ route('user.create') }}" class="btn btn-info"><span>{{ label('Create New') }}</span></a>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="buttons-datatables" class="display table-sm table-bordered table" style="width:100%">
<thead class="">
<tr>
<th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label('Name') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label('Email') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label('User Name') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label('Role') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label('Branch') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label('Employee') }}</span></th>
<th class="tb-col" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
</th>
</tr>
</thead>
<tbody>
@php
$i = 1;
@endphp
@foreach ($data as $item)
<tr data-id="{{ $item->id }}" data-display_order="{{ $item->display_order }}"
class="draggable-row">
<td class="tb-col">{{ $i++ }}</td>
<td class="tb-col">{{ $item->name }}</td>
<td class="tb-col">{{ $item->email }}</td>
<td class="tb-col">{{ $item->username }}</td>
<td class="tb-col">{!! getFieldData('tbl_roles', 'title', 'role_id', $item->roles_id) !!}
<td class="tb-col">{!! getFieldData('tbl_branches', 'title', 'branch_id', $item->branches_id) !!}
<td class="tb-col">{!! getFieldData('tbl_employees', 'title', 'employee_id', $item->employees_id) !!}
</td>
<td class="tb-col">
<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('user.edit', $item->id) }}" class="link-success fs-15 edit-item-btn"><i
class="ri-edit-2-line"></i></a>
<a href="javascript:void(0);" data-link="{{ route('user.destroy', $item->id) }}"
data-id="{{ $item->id }}" class="link-danger fs-15 remove-item-btn"><i
class="ri-delete-bin-line"></i></a>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@include('user::partials.view')
@endsection

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>User 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-user', 'resources/assets/sass/app.scss') }} --}}
</head>
<body>
@yield('content')
{{-- Vite JS --}}
{{-- {{ module_vite('build-user', 'resources/assets/js/app.js') }} --}}
</body>

View File

@ -0,0 +1,23 @@
<div class="mb-3">
<label for="name" class="form-label">Name</label>
<input type="text" class="form-control" id="name" placeholder="Enter name" name="name"
value="{{ old('end_date', $leave->name ?? '') }}" required>
<div class="invalid-feedback">
Please enter employee name.
</div>
</div>
<div class="mb-3">
<label for="email" class="form-label">Email</label>
<input type="text" class="form-control" id="email" name="email"
value="{{ old('email', $leave->email ?? '') }}">
</div>
<div class="text-end">
<button type="submit" class="btn btn-primary">{{ $btnType }}</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 User</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form action="{{ route('user.store') }}" class="needs-validation" novalidate method="post">
@csrf
@include('user::partials.action', ['btnType' => 'View'])
</form>
</div>
</div>
</div>
</div>

View File

View File

@ -0,0 +1,19 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\User\Http\Controllers\UserController;
/*
*--------------------------------------------------------------------------
* 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('user', UserController::class)->names('user');
});

View File

@ -0,0 +1,19 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\User\Http\Controllers\UserController;
/*
|--------------------------------------------------------------------------
| 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('user', UserController::class)->names('user');
});

View File

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