Compare commits

...

7 Commits

Author SHA1 Message Date
ranjangumanju
2dc9e4afe7 fixes 2024-04-04 22:37:34 +05:45
ranjangumanju
5cc42edcba leave moudle setup 2024-04-04 22:01:09 +05:45
dfdc927a56 migration issues 2024-04-04 17:53:23 +05:45
df0cbdf8a0 leave module setup 2024-04-04 16:20:27 +05:45
d59affd0f7 user controller added 2024-04-04 14:04:00 +05:45
df5a77ae94 Merge branch 'omis_ranjan' of http://bibgit.com/dharmaraj/New-OMIS 2024-04-04 13:32:02 +05:45
2f839afe6b toastr added 2024-04-04 13:31:19 +05:45
110 changed files with 3533 additions and 265 deletions

View File

@ -0,0 +1,84 @@
<?php
namespace Modules\Leave\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Modules\Leave\Repositories\LeaveInterface;
class LeaveController extends Controller
{
private LeaveInterface $leaveRepository;
public function __construct(LeaveInterface $leaveRepository)
{
$this->leaveRepository = $leaveRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['leaves'] = $this->leaveRepository->findAll();
// dd($data['leaves']);
return view('leave::index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = 'Create Leave';
return view('leave::create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
$inputData = $request->all();
try {
$this->leaveRepository->create($inputData);
toastr()->success('Leave Created Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('leave.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('leave::show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('leave::edit');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
}

View File

View File

View File

@ -0,0 +1,12 @@
<?php
namespace Modules\Leave\Models;
use Illuminate\Database\Eloquent\Model;
class Leave extends Model
{
protected $table = 'leaves';
protected $guarded = [];
}

View File

View File

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

View File

@ -0,0 +1,49 @@
<?php
namespace Modules\Leave\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('Leave', '/routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Leave', '/routes/api.php'));
}
}

View File

View File

@ -0,0 +1,12 @@
<?php
namespace Modules\Leave\Repositories;
interface LeaveInterface
{
public function findAll();
public function getLeaveById($leaveId);
public function delete($leaveId);
public function create(array $LeaveDetails);
public function update($leaveId, array $newDetails);
}

View File

@ -0,0 +1,34 @@
<?php
namespace Modules\Leave\Repositories;
use Modules\Leave\Models\Leave;
class LeaveRepository implements LeaveInterface
{
public function findAll()
{
return Leave::get();
}
public function getLeaveById($leaveId)
{
return Leave::findOrFail($leaveId);
}
public function delete($leaveId)
{
Leave::destroy($leaveId);
}
public function create(array $leaveDetails)
{
return Leave::create($leaveDetails);
}
public function update($leaveId, array $newDetails)
{
return Leave::whereId($leaveId)->update($newDetails);
}
}

View File

@ -0,0 +1,30 @@
{
"name": "nwidart/leave",
"description": "",
"authors": [
{
"name": "Nicolas Widart",
"email": "n.widart@gmail.com"
}
],
"extra": {
"laravel": {
"providers": [],
"aliases": {
}
}
},
"autoload": {
"psr-4": {
"Modules\\Leave\\": "app/",
"Modules\\Leave\\Database\\Factories\\": "database/factories/",
"Modules\\Leave\\Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Modules\\Leave\\Tests\\": "tests/"
}
}
}

View File

View File

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

View File

@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('leaves', function (Blueprint $table) {
$table->tinyInteger('leave_id')->unsigned()->autoIncrement();
$table->integer('employee_id');
$table->date('start_date');
$table->date('end_date');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('leaves');
}
};

View File

View File

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

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

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

View File

View File

View File

@ -0,0 +1,40 @@
@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.store') }}" class="needs-validation" novalidate method="post">
@csrf
@include('leave::partials.action')
</form>
</div>
</div>
</div>
</div>
<!--end row-->
</div>
<!-- container-fluid -->
</div>
@endsection

View File

@ -0,0 +1,298 @@
@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">Projects</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">Projects</li>
</ol>
</div>
</div>
</div>
</div> --}}
<!-- end page title -->
{{-- <div class="card">
<div class="card-body text-align-center">
<div class="row g-2">
<div class="col-sm-4">
<div class="search-box">
<input type="text" class="form-control" id="searchMemberList"
placeholder="Search for name or designation..." autocomplete="off">
<i class="ri-search-line search-icon"></i>
</div>
</div>
<div class="col-sm-auto ms-auto">
<div class="list-grid-nav hstack gap-1">
<button type="button" id="dropdownMenuLink1" data-bs-toggle="dropdown" aria-expanded="false"
class="btn btn-sm btn-danger">Reset</button>
<button class="btn btn-sm btn-warning" data-bs-toggle="modal"
data-bs-target="#addmemberModal">Search</button>
</div>
</div>
</div>
</div>
</div> --}}
<div class="row">
<div class="col-lg-12">
<div class="card">
<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
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%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</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>
<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>
</table>
</div>
</div>
</div>
</div>
</div><!--end row-->
</div>
<!-- container-fluid -->
</div>
@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>Leave 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-leave', 'resources/assets/sass/app.scss') }} --}}
</head>
<body>
@yield('content')
{{-- Vite JS --}}
{{-- {{ module_vite('build-leave', 'resources/assets/js/app.js') }} --}}
</body>

View File

@ -0,0 +1,30 @@
<div class="mb-3">
<label for="employeeName" class="form-label">Employee Name</label>
<input type="text" class="form-control" id="employeeName" placeholder="Enter employee name" name="employeeName" required>
<div class="invalid-feedback">
Please enter employee name.
</div>
</div>
<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 class="mb-3">
<label for="StartleaveDate" class="form-label">Start Leave Date</label>
<input type="date" class="form-control" id="StartleaveDate" name="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">
</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 class="text-end">
<button type="submit" class="btn btn-primary">Add Leave</button>
</div>
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

View File

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

View File

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

View File

@ -0,0 +1,26 @@
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
build: {
outDir: '../../public/build-leave',
emptyOutDir: true,
manifest: true,
},
plugins: [
laravel({
publicDirectory: '../../public',
buildDirectory: 'build-leave',
input: [
__dirname + '/resources/assets/sass/app.scss',
__dirname + '/resources/assets/js/app.js'
],
refresh: true,
}),
],
});
//export const paths = [
// 'Modules/Leave/resources/assets/sass/app.scss',
// 'Modules/Leave/resources/assets/js/app.js',
//];

View File

@ -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,83 +552,12 @@ 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,
`alias` varchar(255) DEFAULT NULL,
`status` varchar(255) DEFAULT NULL,
`remarks` 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
) 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("
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, `title` varchar(255) DEFAULT NULL,
`alias` varchar(255) DEFAULT NULL, `alias` varchar(255) DEFAULT NULL,
`status` int(11) DEFAULT NULL, `status` varchar(255) DEFAULT NULL,
`remarks` text DEFAULT NULL, `remarks` varchar(255) 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,
@ -639,6 +566,75 @@ class OMIS
) 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("
// 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
DB::statement(" DB::statement("
@ -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;
} }

View File

@ -0,0 +1,45 @@
<?php
namespace App\Http\Controllers;
use App\DataTables\UsersDataTable;
use App\Models\User;
use Illuminate\Http\Request;
use Spatie\Permission\Models\Role;
class UserController extends Controller
{
public function create()
{
$roles = Role::all();
return view('users.create', compact('roles'));
}
public function store(Request $request)
{
$validatedData = $request->validate([
'name' => 'required|min:5',
'email' => 'required',
'password' => 'required',
'role' => 'required',
]);
$user = User::create($validatedData);
$user->roles()->attach($request->role);
toastr()->success('User has been created!');
return redirect()->route('users.index');
}
public function index()
{
$users = User::latest()->get();
return view('users.index', compact('users'));
}
public function destroy(string $id)
{
$user = User::findOrFail($id);
$user->delete();
toastr()->success('Data has been deleted successfully!');
return redirect()->back();
}
}

View File

@ -63,5 +63,8 @@ class Kernel extends HttpKernel
'signed' => \App\Http\Middleware\ValidateSignature::class, 'signed' => \App\Http\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
'role_or_permission' => \Spatie\Permission\Middleware\RoleOrPermissionMiddleware::class,
'role' => \Spatie\Permission\Middleware\RoleMiddleware::class,
'permission' => \Spatie\Permission\Middleware\PermissionMiddleware::class,
]; ];
} }

View File

@ -1,26 +0,0 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class application-logo extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.application-logo');
}
}

View File

@ -1,26 +0,0 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class auth-session-status extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.auth-session-status');
}
}

View File

@ -6,12 +6,15 @@
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": "^8.1", "php": "^8.1",
"barryvdh/laravel-debugbar": "^3.13",
"guzzlehttp/guzzle": "^7.2", "guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.0", "laravel/framework": "^10.0",
"laravel/sanctum": "^3.2", "laravel/sanctum": "^3.2",
"laravel/tinker": "^2.8", "laravel/tinker": "^2.8",
"laravel/ui": "^4.5", "laravel/ui": "^4.5",
"spatie/laravel-permission": "^6.4" "nwidart/laravel-modules": "^11.0",
"spatie/laravel-permission": "^6.4",
"yoeunes/toastr": "^2.3"
}, },
"require-dev": { "require-dev": {
"fakerphp/faker": "^1.9.1", "fakerphp/faker": "^1.9.1",
@ -27,7 +30,12 @@
"App\\": "app/", "App\\": "app/",
"Database\\Factories\\": "database/factories/", "Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/" "Database\\Seeders\\": "database/seeders/"
} },
"files":[
"app/Helpers/OMIS.php",
"app/Helpers/BibClass.php",
"app/Helpers/bibHelper.php"
]
}, },
"autoload-dev": { "autoload-dev": {
"psr-4": { "psr-4": {
@ -55,6 +63,11 @@
}, },
"laravel": { "laravel": {
"dont-discover": [] "dont-discover": []
},
"merge-plugin": {
"include": [
"Modules/*/composer.json"
]
} }
}, },
"config": { "config": {
@ -62,7 +75,8 @@
"preferred-install": "dist", "preferred-install": "dist",
"sort-packages": true, "sort-packages": true,
"allow-plugins": { "allow-plugins": {
"pestphp/pest-plugin": true "pestphp/pest-plugin": true,
"wikimedia/composer-merge-plugin": true
} }
}, },
"minimum-stability": "stable", "minimum-stability": "stable",

592
composer.lock generated
View File

@ -4,8 +4,92 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "9dfe840e3949f0554256147101c42a8e", "content-hash": "18585a0d9833f75d740f42dfc2e2db87",
"packages": [ "packages": [
{
"name": "barryvdh/laravel-debugbar",
"version": "v3.13.3",
"source": {
"type": "git",
"url": "https://github.com/barryvdh/laravel-debugbar.git",
"reference": "241e9bddb04ab42a04a5fe8b2b9654374c864229"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/241e9bddb04ab42a04a5fe8b2b9654374c864229",
"reference": "241e9bddb04ab42a04a5fe8b2b9654374c864229",
"shasum": ""
},
"require": {
"illuminate/routing": "^9|^10|^11",
"illuminate/session": "^9|^10|^11",
"illuminate/support": "^9|^10|^11",
"maximebf/debugbar": "~1.22.0",
"php": "^8.0",
"symfony/finder": "^6|^7"
},
"require-dev": {
"mockery/mockery": "^1.3.3",
"orchestra/testbench-dusk": "^5|^6|^7|^8|^9",
"phpunit/phpunit": "^9.6|^10.5",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.13-dev"
},
"laravel": {
"providers": [
"Barryvdh\\Debugbar\\ServiceProvider"
],
"aliases": {
"Debugbar": "Barryvdh\\Debugbar\\Facades\\Debugbar"
}
}
},
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"Barryvdh\\Debugbar\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"description": "PHP Debugbar integration for Laravel",
"keywords": [
"debug",
"debugbar",
"laravel",
"profiler",
"webprofiler"
],
"support": {
"issues": "https://github.com/barryvdh/laravel-debugbar/issues",
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.13.3"
},
"funding": [
{
"url": "https://fruitcake.nl",
"type": "custom"
},
{
"url": "https://github.com/barryvdh",
"type": "github"
}
],
"time": "2024-04-04T02:42:49+00:00"
},
{ {
"name": "brick/math", "name": "brick/math",
"version": "0.11.0", "version": "0.11.0",
@ -1957,6 +2041,74 @@
], ],
"time": "2024-01-28T23:22:08+00:00" "time": "2024-01-28T23:22:08+00:00"
}, },
{
"name": "maximebf/debugbar",
"version": "v1.22.3",
"source": {
"type": "git",
"url": "https://github.com/maximebf/php-debugbar.git",
"reference": "7aa9a27a0b1158ed5ad4e7175e8d3aee9a818b96"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/7aa9a27a0b1158ed5ad4e7175e8d3aee9a818b96",
"reference": "7aa9a27a0b1158ed5ad4e7175e8d3aee9a818b96",
"shasum": ""
},
"require": {
"php": "^7.2|^8",
"psr/log": "^1|^2|^3",
"symfony/var-dumper": "^4|^5|^6|^7"
},
"require-dev": {
"dbrekelmans/bdi": "^1",
"phpunit/phpunit": "^8|^9",
"symfony/panther": "^1|^2.1",
"twig/twig": "^1.38|^2.7|^3.0"
},
"suggest": {
"kriswallsmith/assetic": "The best way to manage assets",
"monolog/monolog": "Log using Monolog",
"predis/predis": "Redis storage"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.22-dev"
}
},
"autoload": {
"psr-4": {
"DebugBar\\": "src/DebugBar/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Maxime Bouroumeau-Fuseau",
"email": "maxime.bouroumeau@gmail.com",
"homepage": "http://maximebf.com"
},
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"description": "Debug bar in the browser for php application",
"homepage": "https://github.com/maximebf/php-debugbar",
"keywords": [
"debug",
"debugbar"
],
"support": {
"issues": "https://github.com/maximebf/php-debugbar/issues",
"source": "https://github.com/maximebf/php-debugbar/tree/v1.22.3"
},
"time": "2024-04-03T19:39:26+00:00"
},
{ {
"name": "monolog/monolog", "name": "monolog/monolog",
"version": "3.5.0", "version": "3.5.0",
@ -2457,6 +2609,281 @@
], ],
"time": "2023-02-08T01:06:31+00:00" "time": "2023-02-08T01:06:31+00:00"
}, },
{
"name": "nwidart/laravel-modules",
"version": "v11.0.3",
"source": {
"type": "git",
"url": "https://github.com/nWidart/laravel-modules.git",
"reference": "24c5ca340cf9d5cb8d71ebc27e8a5ac70e599a87"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nWidart/laravel-modules/zipball/24c5ca340cf9d5cb8d71ebc27e8a5ac70e599a87",
"reference": "24c5ca340cf9d5cb8d71ebc27e8a5ac70e599a87",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": ">=8.2",
"wikimedia/composer-merge-plugin": "^2.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^v3.52",
"laravel/framework": "^v11.0",
"mockery/mockery": "^1.6",
"orchestra/testbench": "^v9.0",
"phpstan/phpstan": "^1.4",
"phpunit/phpunit": "^11.0",
"spatie/phpunit-snapshot-assertions": "^5.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Nwidart\\Modules\\LaravelModulesServiceProvider"
],
"aliases": {
"Module": "Nwidart\\Modules\\Facades\\Module"
}
},
"branch-alias": {
"dev-master": "11.0-dev"
}
},
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"Nwidart\\Modules\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Widart",
"email": "n.widart@gmail.com",
"homepage": "https://nicolaswidart.com",
"role": "Developer"
}
],
"description": "Laravel Module management",
"keywords": [
"laravel",
"module",
"modules",
"nwidart",
"rad"
],
"support": {
"issues": "https://github.com/nWidart/laravel-modules/issues",
"source": "https://github.com/nWidart/laravel-modules/tree/v11.0.3"
},
"funding": [
{
"url": "https://github.com/dcblogdev",
"type": "github"
},
{
"url": "https://github.com/nwidart",
"type": "github"
}
],
"time": "2024-03-24T23:33:15+00:00"
},
{
"name": "php-flasher/flasher",
"version": "v1.15.14",
"source": {
"type": "git",
"url": "https://github.com/php-flasher/flasher.git",
"reference": "33ae74e73f62814fff4e78e78f912d9b6ddf82d0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-flasher/flasher/zipball/33ae74e73f62814fff4e78e78f912d9b6ddf82d0",
"reference": "33ae74e73f62814fff4e78e78f912d9b6ddf82d0",
"shasum": ""
},
"require": {
"php": ">=5.3"
},
"type": "library",
"autoload": {
"files": [
"helpers.php"
],
"psr-4": {
"Flasher\\Prime\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Younes KHOUBZA",
"email": "younes.khoubza@gmail.com",
"homepage": "https://www.linkedin.com/in/younes-khoubza",
"role": "Developer"
}
],
"description": "PHPFlasher - A powerful & easy-to-use package for adding flash messages to Laravel or Symfony projects. Provides feedback to users, improves engagement & enhances user experience. Intuitive design for beginners & experienced developers. A reliable, flexible solution.",
"homepage": "https://php-flasher.io",
"keywords": [
"custom-adapter",
"dark-mode",
"desktop-notifications",
"flash-messages",
"framework-agnostic",
"javascript",
"laravel",
"notification-system",
"noty",
"notyf",
"php",
"php-flasher",
"phpstorm-auto-complete",
"pnotify",
"rtl",
"sweetalert",
"symfony",
"toastr",
"user-experience",
"user-feedback",
"yoeunes"
],
"support": {
"source": "https://github.com/php-flasher/flasher/tree/v1.15.14"
},
"funding": [
{
"url": "https://www.paypal.com/paypalme/yoeunes",
"type": "custom"
},
{
"url": "https://github.com/yoeunes",
"type": "github"
},
{
"url": "https://ko-fi.com/yoeunes",
"type": "ko_fi"
},
{
"url": "https://opencollective.com/php-flasher",
"type": "open_collective"
},
{
"url": "https://www.patreon.com/yoeunes",
"type": "patreon"
}
],
"time": "2023-12-16T17:11:36+00:00"
},
{
"name": "php-flasher/flasher-laravel",
"version": "v1.15.14",
"source": {
"type": "git",
"url": "https://github.com/php-flasher/flasher-laravel.git",
"reference": "c2777483fd7074087c16f861ce2191a95088e7c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-flasher/flasher-laravel/zipball/c2777483fd7074087c16f861ce2191a95088e7c6",
"reference": "c2777483fd7074087c16f861ce2191a95088e7c6",
"shasum": ""
},
"require": {
"illuminate/support": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
"php": ">=5.3",
"php-flasher/flasher": "^1.15.14"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"Flasher": "Flasher\\Laravel\\Facade\\Flasher"
},
"providers": [
"Flasher\\Laravel\\FlasherServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Flasher\\Laravel\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Younes KHOUBZA",
"email": "younes.khoubza@gmail.com",
"homepage": "https://www.linkedin.com/in/younes-khoubza",
"role": "Developer"
}
],
"description": "PHPFlasher - A powerful & easy-to-use package for adding flash messages to Laravel or Symfony projects. Provides feedback to users, improves engagement & enhances user experience. Intuitive design for beginners & experienced developers. A reliable, flexible solution.",
"homepage": "https://php-flasher.io",
"keywords": [
"custom-adapter",
"dark-mode",
"desktop-notifications",
"flash-messages",
"framework-agnostic",
"javascript",
"laravel",
"notification-system",
"noty",
"notyf",
"php",
"php-flasher",
"phpstorm-auto-complete",
"pnotify",
"rtl",
"sweetalert",
"symfony",
"toastr",
"user-experience",
"user-feedback",
"yoeunes"
],
"support": {
"source": "https://github.com/php-flasher/flasher-laravel/tree/v1.15.14"
},
"funding": [
{
"url": "https://www.paypal.com/paypalme/yoeunes",
"type": "custom"
},
{
"url": "https://github.com/yoeunes",
"type": "github"
},
{
"url": "https://ko-fi.com/yoeunes",
"type": "ko_fi"
},
{
"url": "https://opencollective.com/php-flasher",
"type": "open_collective"
},
{
"url": "https://www.patreon.com/yoeunes",
"type": "patreon"
}
],
"time": "2024-03-16T15:25:14+00:00"
},
{ {
"name": "phpoption/phpoption", "name": "phpoption/phpoption",
"version": "1.9.2", "version": "1.9.2",
@ -5829,6 +6256,167 @@
"source": "https://github.com/webmozarts/assert/tree/1.11.0" "source": "https://github.com/webmozarts/assert/tree/1.11.0"
}, },
"time": "2022-06-03T18:03:27+00:00" "time": "2022-06-03T18:03:27+00:00"
},
{
"name": "wikimedia/composer-merge-plugin",
"version": "v2.1.0",
"source": {
"type": "git",
"url": "https://github.com/wikimedia/composer-merge-plugin.git",
"reference": "a03d426c8e9fb2c9c569d9deeb31a083292788bc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/a03d426c8e9fb2c9c569d9deeb31a083292788bc",
"reference": "a03d426c8e9fb2c9c569d9deeb31a083292788bc",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.1||^2.0",
"php": ">=7.2.0"
},
"require-dev": {
"composer/composer": "^1.1||^2.0",
"ext-json": "*",
"mediawiki/mediawiki-phan-config": "0.11.1",
"php-parallel-lint/php-parallel-lint": "~1.3.1",
"phpspec/prophecy": "~1.15.0",
"phpunit/phpunit": "^8.5||^9.0",
"squizlabs/php_codesniffer": "~3.7.1"
},
"type": "composer-plugin",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
},
"class": "Wikimedia\\Composer\\Merge\\V2\\MergePlugin"
},
"autoload": {
"psr-4": {
"Wikimedia\\Composer\\Merge\\V2\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bryan Davis",
"email": "bd808@wikimedia.org"
}
],
"description": "Composer plugin to merge multiple composer.json files",
"support": {
"issues": "https://github.com/wikimedia/composer-merge-plugin/issues",
"source": "https://github.com/wikimedia/composer-merge-plugin/tree/v2.1.0"
},
"time": "2023-04-15T19:07:00+00:00"
},
{
"name": "yoeunes/toastr",
"version": "v2.3.5",
"source": {
"type": "git",
"url": "https://github.com/yoeunes/toastr.git",
"reference": "5c39d42b4c7b110572b7643bba1cd51b8af89b74"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yoeunes/toastr/zipball/5c39d42b4c7b110572b7643bba1cd51b8af89b74",
"reference": "5c39d42b4c7b110572b7643bba1cd51b8af89b74",
"shasum": ""
},
"require": {
"php": ">=5.3",
"php-flasher/flasher-laravel": "^1.15.14"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"Toastr": "Yoeunes\\Toastr\\Facades\\Toastr"
},
"providers": [
"Yoeunes\\Toastr\\ToastrServiceProvider"
]
}
},
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"Yoeunes\\Toastr\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Younes KHOUBZA",
"email": "younes.khoubza@gmail.com",
"homepage": "https://www.linkedin.com/in/younes-khoubza",
"role": "Developer"
}
],
"description": "toastr.js flush notifications for Laravel",
"homepage": "https://github.com/yoeunes/toastr",
"keywords": [
"custom-adapter",
"dark-mode",
"desktop-notifications",
"flash-messages",
"framework-agnostic",
"javascript",
"laravel",
"notification-system",
"noty",
"notyf",
"php",
"php-flasher",
"phpstorm-auto-complete",
"pnotify",
"rtl",
"sweetalert",
"symfony",
"toastr",
"toastr js",
"user-experience",
"user-feedback",
"yoeunes"
],
"support": {
"docs": "https://github.com/yoeunes/toastr/README.md",
"email": "younes.khoubza@gmail.com",
"issues": "https://github.com/yoeunes/toastr/issues",
"source": "https://github.com/yoeunes/toastr"
},
"funding": [
{
"url": "https://www.paypal.com/paypalme/yoeunes",
"type": "custom"
},
{
"url": "https://github.com/yoeunes",
"type": "github"
},
{
"url": "https://ko-fi.com/yoeunes",
"type": "ko_fi"
},
{
"url": "https://opencollective.com/php-flasher",
"type": "open_collective"
},
{
"url": "https://www.patreon.com/yoeunes",
"type": "patreon"
}
],
"time": "2024-03-16T15:29:23+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [
@ -8277,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"
} }

19
config/flasher_toastr.php Normal file
View File

@ -0,0 +1,19 @@
<?php
/*
* This file is part of the yoeunes/toastr package.
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
*/
return array(
'scripts' => array(
'cdn' => array(
'https://cdn.jsdelivr.net/npm/jquery@3.6.3/dist/jquery.min.js',
'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.2.4/dist/flasher-toastr.min.js',
),
'local' => array(
'/vendor/flasher/jquery.min.js',
'/vendor/flasher/flasher-toastr.min.js',
),
),
);

259
config/modules.php Normal file
View File

@ -0,0 +1,259 @@
<?php
use Nwidart\Modules\Activators\FileActivator;
use Nwidart\Modules\Providers\ConsoleServiceProvider;
return [
/*
|--------------------------------------------------------------------------
| Module Namespace
|--------------------------------------------------------------------------
|
| Default module namespace.
|
*/
'namespace' => 'Modules',
/*
|--------------------------------------------------------------------------
| Module Stubs
|--------------------------------------------------------------------------
|
| Default module stubs.
|
*/
'stubs' => [
'enabled' => false,
'path' => base_path('vendor/nwidart/laravel-modules/src/Commands/stubs'),
'files' => [
'routes/web' => 'routes/web.php',
'routes/api' => 'routes/api.php',
'views/index' => 'resources/views/index.blade.php',
'views/master' => 'resources/views/layouts/master.blade.php',
'scaffold/config' => 'config/config.php',
'composer' => 'composer.json',
'assets/js/app' => 'resources/assets/js/app.js',
'assets/sass/app' => 'resources/assets/sass/app.scss',
'vite' => 'vite.config.js',
'package' => 'package.json',
],
'replacements' => [
'routes/web' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE', 'CONTROLLER_NAMESPACE'],
'routes/api' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE', 'CONTROLLER_NAMESPACE'],
'vite' => ['LOWER_NAME', 'STUDLY_NAME'],
'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE', 'PROVIDER_NAMESPACE'],
'views/index' => ['LOWER_NAME'],
'views/master' => ['LOWER_NAME', 'STUDLY_NAME'],
'scaffold/config' => ['STUDLY_NAME'],
'composer' => [
'LOWER_NAME',
'STUDLY_NAME',
'VENDOR',
'AUTHOR_NAME',
'AUTHOR_EMAIL',
'MODULE_NAMESPACE',
'PROVIDER_NAMESPACE',
],
],
'gitkeep' => true,
],
'paths' => [
/*
|--------------------------------------------------------------------------
| Modules path
|--------------------------------------------------------------------------
|
| This path is used to save the generated module.
| This path will also be added automatically to the list of scanned folders.
|
*/
'modules' => base_path('Modules'),
/*
|--------------------------------------------------------------------------
| Modules assets path
|--------------------------------------------------------------------------
|
| Here you may update the modules' assets path.
|
*/
'assets' => public_path('modules'),
/*
|--------------------------------------------------------------------------
| The migrations' path
|--------------------------------------------------------------------------
|
| Where you run the 'module:publish-migration' command, where do you publish the
| the migration files?
|
*/
'migration' => base_path('database/migrations'),
/*
|--------------------------------------------------------------------------
| The app path
|--------------------------------------------------------------------------
|
| app folder name
| for example can change it to 'src' or 'App'
*/
'app_folder' => 'app/',
/*
|--------------------------------------------------------------------------
| Generator path
|--------------------------------------------------------------------------
| Customise the paths where the folders will be generated.
| Setting the generate key to false will not generate that folder
*/
'generator' => [
// app/
'channels' => ['path' => 'app/Broadcasting', 'generate' => false],
'command' => ['path' => 'app/Console', 'generate' => false],
'emails' => ['path' => 'app/Emails', 'generate' => false],
'event' => ['path' => 'app/Events', 'generate' => false],
'jobs' => ['path' => 'app/Jobs', 'generate' => false],
'listener' => ['path' => 'app/Listeners', 'generate' => false],
'model' => ['path' => 'app/Models', 'generate' => true],
'notifications' => ['path' => 'app/Notifications', 'generate' => false],
'observer' => ['path' => 'app/Observers', 'generate' => false],
'policies' => ['path' => 'app/Policies', 'generate' => false],
'provider' => ['path' => 'app/Providers', 'generate' => true],
'route-provider' => ['path' => 'app/Providers', 'generate' => true],
'repository' => ['path' => 'app/Repositories', 'generate' => true],
'resource' => ['path' => 'app/Transformers', 'generate' => false],
'rules' => ['path' => 'app/Rules', 'generate' => false],
'component-class' => ['path' => 'app/View/Components', 'generate' => false],
// app/Http/
'controller' => ['path' => 'app/Http/Controllers', 'generate' => true],
'filter' => ['path' => 'app/Http/Middleware', 'generate' => false],
'request' => ['path' => 'app/Http/Requests', 'generate' => true],
// config/
'config' => ['path' => 'config', 'generate' => true],
// database/
'migration' => ['path' => 'database/migrations', 'generate' => true],
'seeder' => ['path' => 'database/seeders', 'generate' => true],
'factory' => ['path' => 'database/factories', 'generate' => true],
// lang/
'lang' => ['path' => 'lang', 'generate' => false],
// resource/
'assets' => ['path' => 'resources/assets', 'generate' => true],
'views' => ['path' => 'resources/views', 'generate' => true],
'component-view' => ['path' => 'resources/views/components', 'generate' => false],
// routes/
'routes' => ['path' => 'routes', 'generate' => true],
// tests/
'test-unit' => ['path' => 'tests/Unit', 'generate' => false],
'test-feature' => ['path' => 'tests/Feature', 'generate' => false],
],
],
/*
|--------------------------------------------------------------------------
| Package commands
|--------------------------------------------------------------------------
|
| Here you can define which commands will be visible and used in your
| application. You can add your own commands to merge section.
|
*/
'commands' => ConsoleServiceProvider::defaultCommands()
->merge([
// New commands go here
])->toArray(),
/*
|--------------------------------------------------------------------------
| Scan Path
|--------------------------------------------------------------------------
|
| Here you define which folder will be scanned. By default will scan vendor
| directory. This is useful if you host the package in packagist website.
|
*/
'scan' => [
'enabled' => false,
'paths' => [
base_path('vendor/*/*'),
],
],
/*
|--------------------------------------------------------------------------
| Composer File Template
|--------------------------------------------------------------------------
|
| Here is the config for the composer.json file, generated by this package
|
*/
'composer' => [
'vendor' => env('MODULES_VENDOR', 'nwidart'),
'author' => [
'name' => env('MODULES_NAME', 'Nicolas Widart'),
'email' => env('MODULES_EMAIL', 'n.widart@gmail.com'),
],
'composer-output' => false,
],
/*
|--------------------------------------------------------------------------
| Caching
|--------------------------------------------------------------------------
|
| Here is the config for setting up the caching feature.
|
*/
'cache' => [
'enabled' => false,
'driver' => 'file',
'key' => 'laravel-modules',
'lifetime' => 60,
],
/*
|--------------------------------------------------------------------------
| Choose what laravel-modules will register as custom namespaces.
| Setting one to false will require you to register that part
| in your own Service Provider class.
|--------------------------------------------------------------------------
*/
'register' => [
'translations' => true,
/**
* load files on boot or register method
*/
'files' => 'register',
],
/*
|--------------------------------------------------------------------------
| Activators
|--------------------------------------------------------------------------
|
| You can define new types of activators here, file, database, etc. The only
| required parameter is 'class'.
| The file activator will store the activation status in storage/installed_modules
*/
'activators' => [
'file' => [
'class' => FileActivator::class,
'statuses-file' => base_path('modules_statuses.json'),
'cache-key' => 'activator.installed',
'cache-lifetime' => 604800,
],
],
'activator' => 'file',
];

27
config/toastr.php Normal file
View File

@ -0,0 +1,27 @@
<?php
/*
* This file is part of the yoeunes/toastr package.
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
*/
return array(
/*
|--------------------------------------------------------------------------
| Toastr options
|--------------------------------------------------------------------------
|
| Here you can specify the options that will be passed to the toastr.js
| library. For a full list of options, visit the documentation.
|
| Example:
| 'options' => [
| 'closeButton' => true,
| 'debug' => false,
| 'newestOnTop' => false,
| 'progressBar' => true,
| ],
*/
'options' => array(),
);

View File

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

4
modules_statuses.json Normal file
View File

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

2
package-lock.json generated
View File

@ -1,5 +1,5 @@
{ {
"name": "OMIS-SETUP", "name": "New-OMIS",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {

File diff suppressed because one or more lines are too long

2
public/vendor/flasher/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" data-layout="vertical" data-topbar="light" data-sidebar="dark" data-sidebar-size="lg" <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> <head>
@ -14,6 +14,12 @@
<!-- App favicon --> <!-- App favicon -->
<link rel="shortcut icon" href="{{ asset('assets/images/favicon.ico') }}"> <link rel="shortcut icon" href="{{ asset('assets/images/favicon.ico') }}">
<!--datatable css-->
<link rel="stylesheet" href="https://cdn.datatables.net/1.11.5/css/dataTables.bootstrap5.min.css" />
<!--datatable responsive css-->
<link rel="stylesheet" href="https://cdn.datatables.net/responsive/2.2.9/css/responsive.bootstrap.min.css" />
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.2/css/buttons.dataTables.min.css">
<!-- Layout config Js --> <!-- Layout config Js -->
<script src="{{ asset('assets/js/layout.js') }}"></script> <script src="{{ asset('assets/js/layout.js') }}"></script>
<!-- Bootstrap Css --> <!-- Bootstrap Css -->
@ -93,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>
@ -106,6 +112,16 @@
<script src="{{ asset('assets/libs/@ckeditor/ckeditor5-build-classic/build/ckeditor.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/toastr/toastr.min.js') }}"></script>
<script src="{{ asset('assets/libs/nepalidatepicker/jquery.nepaliDatePicker.min.js') }}"></script> <script src="{{ asset('assets/libs/nepalidatepicker/jquery.nepaliDatePicker.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>
<script src="https://cdn.datatables.net/buttons/2.2.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.2/js/buttons.print.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.2/js/buttons.html5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="{{ asset('assets/js/pages/datatables.init.js') }}"></script>
<!--apexcharts--> <!--apexcharts-->
<script src="{{ asset('assets/libs/apexcharts/apexcharts.min.js') }}"></script> <script src="{{ asset('assets/libs/apexcharts/apexcharts.min.js') }}"></script>
@ -122,7 +138,7 @@
<!-- 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>

View File

@ -63,6 +63,13 @@
</ul> </ul>
</div> </div>
</li> </li>
<li class="nav-item">
<a class="nav-link menu-link active" href="{{ route('leave.index') }}">
<i class="ri-honour-line"></i> <span data-key="t-widgets">Leave</span>
</a>
</li>
</ul> </ul>
</div> </div>
<!-- Sidebar --> <!-- Sidebar -->

View File

@ -1,4 +1,5 @@
<x-app-layout> @extends('layouts.app')
@section('content')
<section class="section"> <section class="section">
<div class="section-header"> <div class="section-header">
<h1>Manage Permission</h1> <h1>Manage Permission</h1>
@ -36,4 +37,4 @@
</div> </div>
</div> </div>
</section> </section>
</x-app-layout> @endsection

View File

@ -1,4 +1,5 @@
<x-app-layout> @extends('layouts.app')
@section('content')
<section class="section"> <section class="section">
<div class="section-header"> <div class="section-header">
<h1>Manage Permissions</h1> <h1>Manage Permissions</h1>
@ -19,13 +20,13 @@
<div class="col-md-7"> <div class="col-md-7">
<div class="form-group"> <div class="form-group">
<label for="name">Permission Name <span class="text-danger">*</span></label> <label for="name">Permission Name <span class="text-danger">*</span></label>
<input id="name" class="rounded-md form-control" value="{{ old('name', $permission->name) }}" <input id="name" class="form-control rounded-md" value="{{ old('name', $permission->name) }}"
type="text" name="name" /> type="text" name="name" />
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="justify-end col-md-12 d-flex"> <div class="col-md-12 d-flex justify-end">
<button type="submit" class="btn btn-primary">Update</button> <button type="submit" class="btn btn-primary">Update</button>
</div> </div>
</div> </div>
@ -33,4 +34,4 @@
</div> </div>
</div> </div>
</section> </section>
</x-app-layout> @endsection

View File

@ -1,4 +1,5 @@
<x-app-layout> @extends('layouts.app')
@section('content')
<section class="section"> <section class="section">
<div class="section-header"> <div class="section-header">
<h1>List Permissions</h1> <h1>List Permissions</h1>
@ -51,4 +52,4 @@
</div> </div>
</div> </div>
</section> </section>
</x-app-layout> @endsection

View File

@ -1,4 +1,5 @@
<x-app-layout> @extends('layouts.app')
@section('content')
<section class="section"> <section class="section">
<div class="section-header"> <div class="section-header">
<h1>Add New Role</h1> <h1>Add New Role</h1>
@ -53,4 +54,4 @@
</div> </div>
</div> </div>
</section> </section>
</x-app-layout> @endsection

View File

@ -1,4 +1,5 @@
<x-app-layout> @extends('layouts.app')
@section('content')
<section class="section"> <section class="section">
<div class="section-header"> <div class="section-header">
<h1>Manage Roles</h1> <h1>Manage Roles</h1>
@ -50,4 +51,4 @@
</div> </div>
</div> </div>
</section> </section>
</x-app-layout> @endsection

View File

@ -1,4 +1,5 @@
<x-app-layout> @extends('layouts.app')
@section('content')
<section class="section"> <section class="section">
<div class="section-header"> <div class="section-header">
<h1>List Roles</h1> <h1>List Roles</h1>
@ -32,8 +33,8 @@
@endforeach @endforeach
<td> <td>
@can('edit roles') @can('edit roles')
<a href="{{ route('roles.edit', $role->id) }}" <a href="{{ route('roles.edit', $role->id) }}" class="btn btn-primary btn-sm rounded-lg text-white"><i
class="btn btn-primary btn-sm rounded-lg text-white"><i class="fas fa-edit"></i></a> class="fas fa-edit"></i></a>
@endcan @endcan
@can('delete roles') @can('delete roles')
<form method="post" action="{{ route('roles.destroy', $role->id) }}"> <form method="post" action="{{ route('roles.destroy', $role->id) }}">
@ -55,4 +56,4 @@
</div> </div>
</div> </div>
</section> </section>
</x-app-layout> @endsection

View File

@ -0,0 +1,67 @@
@extends('layouts.app')
@section('content')
<section class="section">
<div class="section-header">
<h1>Create User</h1>
</div>
<div class="card">
<div class="card-header d-flex justify-content-between">
<h5>Add New User</h5>
<a href="{{ route('users.index') }}" class="btn btn-primary btn-sm">Back</a>
</div>
<div class="card-body">
<div class="card-body">
<form action="{{ route('users.store') }}" method="post" enctype="multipart/form-data">
@csrf
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="name">Name <span class="text-danger">*</span></label>
<input id="name" class="form-control rounded-md" type="text" name="name" required />
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="email">Email <span class="text-danger">*</span></label>
<input id="email" class="form-control rounded-md" type="text" name="email" required />
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="password">Password <span class="text-danger">*</span></label>
<input id="password" class="form-control rounded-md" type="password" name="password" required />
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="role_id">Role<span class="text-danger">*</span></label>
<select class="form-control rounded-md" name="role">
@foreach ($roles as $role)
<option value="{{ $role->id }}">{{ $role->name }}</option>
@endforeach
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 d-flex justify-end">
<button type="submit" class="btn btn-primary">Save Record</button>
</div>
</div>
</form>
</div>
</div>
</div>
</section>
@endsection

View File

@ -0,0 +1,55 @@
@extends('layouts.app')
@section('content')
<section class="section">
<div class="section-header">
<h1>List users</h1>
</div>
<div class="card">
<div class="card-header d-flex justify-end p-3">
@can('create users')
<a href="{{ route('users.create') }}" class="btn btn-primary btn-sm">New User</a>
@endcan
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table-bordered table">
<thead>
<tr>
<th class="border-1 border">S.N</th>
<th class="border-1 border">Name</th>
<th class="border-1 border">Action</th>
</tr>
</thead>
<tbody>
@can('access users')
@foreach ($users as $permission)
<tr>
<td>{{ $permission->id }}</td>
<td>{{ $permission->name }}</td>
<td>
@can('edit users')
<a href="{{ route('users.edit', $permission->id) }}"
class="btn btn-primary btn-sm rounded-lg text-white"><i class="fas fa-edit"></i></a>
@endcan
@can('delete users')
<form action="{{ route('users.destroy', $permission->id) }}" method="post">
@csrf
@method('delete')
<a href="{{ route('users.destroy', $permission->id) }}"
class="btn btn-danger btn-sm rounded-lg text-white"
onclick="event.preventDefault();this.closest('form').submit();"><i
class="fas fa-trash-alt"></i></a>
</form>
@endcan
</td>
</tr>
@endforeach
@endcan
</tbody>
</table>
</div>
</div>
</div>
</section>
@endsection

View File

@ -1,5 +1,8 @@
<?php <?php
use App\Http\Controllers\PermissionController;
use App\Http\Controllers\RoleController;
use App\Http\Controllers\UserController;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
/* /*
@ -11,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');
@ -20,3 +23,11 @@ Route::get('/', function () {
Auth::routes(); Auth::routes();
Route::get('/dashboard', [App\Http\Controllers\HomeController::class, 'index'])->name('home'); Route::get('/dashboard', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
Route::resource('roles', RoleController::class)->names('roles');
Route::resource('permissions', PermissionController::class)->names('permissions');
Route::resource('users', UserController::class)->names('users');
Route::get('/initialize-db', function () {
OMIS::initDB();
});

2
storage/debugbar/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

View File

View File

@ -0,0 +1,24 @@
<?php
namespace $NAMESPACE$;
class $CLASS$
{
/**
* Create a new channel instance.
*/
public function __construct()
{
//
}
/**
* Authenticate the user's access to the channel.
*/
public function join(Operator $user): array|bool
{
//
}
}

View File

@ -0,0 +1,56 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class $CLASS$ extends Command
{
/**
* The name and signature of the console command.
*/
protected $signature = '$COMMAND_NAME$';
/**
* The console command description.
*/
protected $description = 'Command description.';
/**
* Create a new command instance.
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*/
public function handle()
{
//
}
/**
* Get the console command arguments.
*/
protected function getArguments(): array
{
return [
['example', InputArgument::REQUIRED, 'An example argument.'],
];
}
/**
* Get the console command options.
*/
protected function getOptions(): array
{
return [
['example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null],
];
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace $NAMESPACE$;
use Illuminate\View\Component;
use Illuminate\View\View;
class $CLASS$ extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view/contents that represent the component.
*/
public function render(): View|string
{
return view('$LOWER_NAME$::$COMPONENT_NAME$');
}
}

View File

@ -0,0 +1,3 @@
<div>
<!-- $QUOTE$ -->
</div>

View File

@ -0,0 +1,30 @@
{
"name": "$VENDOR$/$LOWER_NAME$",
"description": "",
"authors": [
{
"name": "$AUTHOR_NAME$",
"email": "$AUTHOR_EMAIL$"
}
],
"extra": {
"laravel": {
"providers": [],
"aliases": {
}
}
},
"autoload": {
"psr-4": {
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\": "app/",
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\Database\\Factories\\": "database/factories/",
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\Tests\\": "tests/"
}
}
}

View File

@ -0,0 +1,59 @@
<?php
namespace $CLASS_NAMESPACE$;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class $CLASS$ extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
//
return response()->json([]);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
return response()->json([]);
}
/**
* Show the specified resource.
*/
public function show($id)
{
//
return response()->json([]);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id)
{
//
return response()->json([]);
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
return response()->json([]);
}
}

View File

@ -0,0 +1,9 @@
<?php
namespace $CLASS_NAMESPACE$;
use Illuminate\Routing\Controller;
class $CLASS$ extends Controller
{
}

View File

@ -0,0 +1,67 @@
<?php
namespace $CLASS_NAMESPACE$;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class $CLASS$ extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('$LOWER_NAME$::index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('$LOWER_NAME$::create');
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
//
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('$LOWER_NAME$::show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('$LOWER_NAME$::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

@ -0,0 +1,34 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class $CLASS$
{
use Dispatchable, InteractsWithSockets, SerializesModels;
/**
* Create a new event instance.
*/
public function __construct()
{
//
}
/**
* Get the channels the event should be broadcast on.
*/
public function broadcastOn(): array
{
return [
new PrivateChannel('channel-name'),
];
}
}

View File

@ -0,0 +1,22 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Database\Eloquent\Factories\Factory;
class $NAME$Factory extends Factory
{
/**
* The name of the factory's corresponding model.
*/
protected $model = \$MODEL_NAMESPACE$\$NAME$::class;
/**
* Define the model's default state.
*/
public function definition(): array
{
return [];
}
}

View File

@ -0,0 +1,20 @@
<?php
namespace $NAMESPACE$;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
class $CLASS$ extends TestCase
{
/**
* A basic feature test example.
*/
public function testExample(): void
{
$response = $this->get('/');
$response->assertStatus(200);
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
class $CLASS$ implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Create a new job instance.
*/
public function __construct()
{
//
}
/**
* Execute the job.
*/
public function handle(): void
{
//
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Bus\Queueable;
use Illuminate\Foundation\Bus\Dispatchable;
class $CLASS$ implements ShouldQueue
{
use Dispatchable, Queueable;
/**
* Create a new job instance.
*/
public function __construct()
{
//
}
/**
* Execute the job.
*/
public function handle(): void
{
//
}
}

View File

@ -0,0 +1,11 @@
{
"name": "$STUDLY_NAME$",
"alias": "$LOWER_NAME$",
"description": "",
"keywords": [],
"priority": 0,
"providers": [
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\$PROVIDER_NAMESPACE$\\$STUDLY_NAME$ServiceProvider"
],
"files": []
}

View File

@ -0,0 +1,25 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class $CLASS$
{
/**
* Create the event listener.
*/
public function __construct()
{
//
}
/**
* Handle the event.
*/
public function handle($event): void
{
//
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class $CLASS$ implements ShouldQueue
{
use InteractsWithQueue;
/**
* Create the event listener
*/
public function __construct()
{
//
}
/**
* Handle the event.
*/
public function handle($event): void
{
//
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace $NAMESPACE$;
use $EVENTNAME$;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class $CLASS$ implements ShouldQueue
{
use InteractsWithQueue;
/**
* Create the event listener.
*/
public function __construct()
{
//
}
/**
* Handle the event.
*/
public function handle($SHORTEVENTNAME$ $event): void
{
//
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace $NAMESPACE$;
use $EVENTNAME$;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class $CLASS$
{
/**
* Create the event listener.
*/
public function __construct()
{
//
}
/**
* Handle the event.
*/
public function handle($SHORTEVENTNAME$ $event): void
{
//
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class $CLASS$ extends Mailable
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*/
public function __construct()
{
//
}
/**
* Build the message.
*/
public function build(): self
{
return $this->view('view.name');
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace $NAMESPACE$;
use Closure;
use Illuminate\Http\Request;
class $CLASS$
{
/**
* Handle an incoming request.
*/
public function handle(Request $request, Closure $next)
{
return $next($request);
}
}

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('$TABLE$', function (Blueprint $table) {
$FIELDS_UP$
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('$TABLE$', function (Blueprint $table) {
$FIELDS_DOWN$
});
}
};

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('$TABLE$', function (Blueprint $table) {
$table->id();
$FIELDS$
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('$TABLE$');
}
};

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('$TABLE$', function (Blueprint $table) {
$FIELDS_UP$
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('$TABLE$', function (Blueprint $table) {
$FIELDS_DOWN$
});
}
};

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::dropIfExists('$TABLE$');
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::create('$TABLE$', function (Blueprint $table) {
$table->id();
$FIELDS$
$table->timestamps();
});
}
};

View File

@ -0,0 +1,24 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
//
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};

View File

@ -0,0 +1,22 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use $MODULE_NAMESPACE$\$MODULE$\Database\factories\$NAME$Factory;
class $CLASS$ extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*/
protected $fillable = $FILLABLE$;
protected static function newFactory(): $NAME$Factory
{
//return $NAME$Factory::new();
}
}

View File

@ -0,0 +1,48 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class $CLASS$ extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*/
public function __construct()
{
//
}
/**
* Get the notification's delivery channels.
*/
public function via($notifiable): array
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*/
public function toMail($notifiable): MailMessage
{
return (new MailMessage)
->line('The introduction to the notification.')
->action('Notification Action', 'https://laravel.com')
->line('Thank you for using our application!');
}
/**
* Get the array representation of the notification.
*/
public function toArray($notifiable): array
{
return [];
}
}

View File

@ -0,0 +1,48 @@
<?php
namespace $NAMESPACE$;
use $MODEL_NAMESPACE$\$NAME$;
class $NAME$Observer
{
/**
* Handle the $NAME$ "created" event.
*/
public function created($NAME$ $NAME_VARIABLE$): void
{
//
}
/**
* Handle the $NAME$ "updated" event.
*/
public function updated($NAME$ $NAME_VARIABLE$): void
{
//
}
/**
* Handle the $NAME$ "deleted" event.
*/
public function deleted($NAME$ $NAME_VARIABLE$): void
{
//
}
/**
* Handle the $NAME$ "restored" event.
*/
public function restored($NAME$ $NAME_VARIABLE$): void
{
//
}
/**
* Handle the $NAME$ "force deleted" event.
*/
public function forceDeleted($NAME$ $NAME_VARIABLE$): void
{
//
}
}

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,18 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Auth\Access\HandlesAuthorization;
class $CLASS$
{
use HandlesAuthorization;
/**
* Create a new policy instance.
*/
public function __construct()
{
//
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Support\ServiceProvider;
class $CLASS$ extends ServiceProvider
{
/**
* Register the service provider.
*/
public function register(): void
{
//
}
/**
* Get the services provided by the provider.
*/
public function provides(): array
{
return [];
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Foundation\Http\FormRequest;
class $CLASS$ extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
//
];
}
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\ResourceCollection;
class $CLASS$ extends ResourceCollection
{
/**
* Transform the resource collection into an array.
*/
public function toArray(Request $request): array
{
return parent::toArray($request);
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class $CLASS$ extends JsonResource
{
/**
* Transform the resource into an array.
*/
public function toArray(Request $request): array
{
return parent::toArray($request);
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace $NAMESPACE$;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class $CLASS$ 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('$MODULE$', '$WEB_ROUTES_PATH$'));
}
/**
* 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('$MODULE$', '$API_ROUTES_PATH$'));
}
}

View File

@ -0,0 +1,19 @@
<?php
use Illuminate\Support\Facades\Route;
use $MODULE_NAMESPACE$\$STUDLY_NAME$\$CONTROLLER_NAMESPACE$\$STUDLY_NAME$Controller;
/*
*--------------------------------------------------------------------------
* 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('$LOWER_NAME$', $STUDLY_NAME$Controller::class)->names('$LOWER_NAME$');
});

View File

@ -0,0 +1,19 @@
<?php
use Illuminate\Support\Facades\Route;
use $MODULE_NAMESPACE$\$STUDLY_NAME$\$CONTROLLER_NAMESPACE$\$STUDLY_NAME$Controller;
/*
|--------------------------------------------------------------------------
| 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('$LOWER_NAME$', $STUDLY_NAME$Controller::class)->names('$LOWER_NAME$');
});

View File

@ -0,0 +1,22 @@
<?php
namespace $NAMESPACE$;
use Closure;
use Illuminate\Contracts\Validation\ValidationRule;
class $CLASS$ implements ValidationRule
{
/**
* Indicates whether the rule should be implicit.
*/
public bool $implicit = true;
/**
* Run the validation rule.
*/
public function validate(string $attribute, mixed $value, Closure $fail): void
{
//
}
}

Some files were not shown because too many files have changed in this diff Show More