├── public
├── favicon.ico
├── robots.txt
├── assets
│ ├── images
│ │ └── icons.png
│ ├── js
│ │ ├── off-canvas.js
│ │ ├── hoverable-collapse.js
│ │ ├── dashboard.js
│ │ ├── settings.js
│ │ ├── template.js
│ │ └── spin.js
│ └── css
│ │ ├── spin.css
│ │ └── vendor.bundle.base.css
├── .htaccess
└── index.php
├── resources
├── css
│ └── app.css
├── js
│ ├── app.js
│ └── bootstrap.js
└── views
│ ├── mailtemplates
│ └── announcement.blade.php
│ ├── admin
│ ├── chat.blade.php
│ ├── viewcustomers.blade.php
│ ├── view_products.blade.php
│ ├── announcement.blade.php
│ ├── view_payments.blade.php
│ └── createrooms.blade.php
│ └── workers
│ ├── chat.blade.php
│ └── view_transaction.blade.php
├── database
├── .gitignore
├── seeders
│ └── DatabaseSeeder.php
├── migrations
│ ├── 2014_10_12_100000_create_password_reset_tokens_table.php
│ ├── 2023_03_25_125205_create_rooms_table.php
│ ├── 2023_03_24_132710_create_users_table.php
│ ├── 2023_03_30_060122_create_announcement_table.php
│ ├── 2019_08_19_000000_create_failed_jobs_table.php
│ ├── 2023_03_28_154134_create_expenses_table.php
│ ├── 2023_03_30_074301_create_chat_table.php
│ ├── 2019_12_14_000001_create_personal_access_tokens_table.php
│ ├── 2023_03_26_102548_create_products_table.php
│ ├── 2023_03_26_124018_create_payments_table.php
│ ├── 2023_03_28_053913_create_access_control_table.php
│ ├── 2023_03_29_071655_create_clock_table.php
│ ├── 2023_03_26_040032_create_customers_table.php
│ ├── 2023_03_27_121435_create_payment_balance_table.php
│ ├── 2023_03_27_122702_create_product_balance_table.php
│ └── 2023_03_27_090624_create_transactions_table.php
└── factories
│ └── UserFactory.php
├── bootstrap
├── cache
│ └── .gitignore
└── app.php
├── storage
├── logs
│ └── .gitignore
├── app
│ ├── public
│ │ └── .gitignore
│ └── .gitignore
└── framework
│ ├── testing
│ └── .gitignore
│ ├── views
│ └── .gitignore
│ ├── cache
│ ├── data
│ │ └── .gitignore
│ └── .gitignore
│ ├── sessions
│ └── .gitignore
│ └── .gitignore
├── tests
├── TestCase.php
├── Unit
│ └── ExampleTest.php
├── Feature
│ └── ExampleTest.php
└── CreatesApplication.php
├── .gitattributes
├── package.json
├── vite.config.js
├── app
├── Models
│ ├── ClockModel.php
│ ├── Payment_Balance.php
│ ├── AnnouncementModel.php
│ ├── Products.php
│ ├── ExpensesModel.php
│ ├── Product_Balance.php
│ ├── Access_Control.php
│ ├── ChatModel.php
│ ├── Payments.php
│ ├── Customers.php
│ ├── Transactions.php
│ ├── RoomsModel.php
│ ├── Users.php
│ └── User.php
├── Http
│ ├── Controllers
│ │ ├── Controller.php
│ │ ├── roomcontroller.php
│ │ ├── paymentcontroller.php
│ │ ├── expensescontroller.php
│ │ ├── admincontroller.php
│ │ ├── productcontroller.php
│ │ ├── customercontroller.php
│ │ ├── chatcontroller.php
│ │ ├── logincontroller.php
│ │ ├── announcementcontroller.php
│ │ ├── userscontroller.php
│ │ ├── accesscontroller.php
│ │ ├── workertransactioncontroller.php
│ │ ├── clockcontroller.php
│ │ ├── workercontroller.php
│ │ └── transactioncontroller.php
│ ├── Middleware
│ │ ├── EncryptCookies.php
│ │ ├── VerifyCsrfToken.php
│ │ ├── PreventRequestsDuringMaintenance.php
│ │ ├── TrimStrings.php
│ │ ├── TrustHosts.php
│ │ ├── Authenticate.php
│ │ ├── ValidateSignature.php
│ │ ├── AuthCheck.php
│ │ ├── CheckWorkerStatus.php
│ │ ├── CheckAdminStatus.php
│ │ ├── TrustProxies.php
│ │ └── RedirectIfAuthenticated.php
│ └── Kernel.php
├── Providers
│ ├── BroadcastServiceProvider.php
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
├── Console
│ └── Kernel.php
└── Exceptions
│ └── Handler.php
├── .gitignore
├── .editorconfig
├── routes
├── channels.php
├── api.php
└── console.php
├── config
├── cors.php
├── services.php
├── view.php
├── hashing.php
├── broadcasting.php
├── sanctum.php
├── filesystems.php
├── queue.php
├── cache.php
├── mail.php
├── logging.php
├── auth.php
└── database.php
├── phpunit.xml
├── .env.example
├── artisan
├── composer.json
└── README.md
/public/favicon.ico:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/css/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite*
2 |
--------------------------------------------------------------------------------
/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/resources/js/app.js:
--------------------------------------------------------------------------------
1 | import './bootstrap';
2 |
--------------------------------------------------------------------------------
/storage/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/storage/app/public/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/app/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !public/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/storage/framework/testing/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/views/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/cache/data/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/sessions/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !data/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/public/assets/images/icons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Hancie123/Fireworks/HEAD/public/assets/images/icons.png
--------------------------------------------------------------------------------
/storage/framework/.gitignore:
--------------------------------------------------------------------------------
1 | compiled.php
2 | config.php
3 | down
4 | events.scanned.php
5 | maintenance.php
6 | routes.php
7 | routes.scanned.php
8 | schedule-*
9 | services.json
10 |
--------------------------------------------------------------------------------
/tests/TestCase.php:
--------------------------------------------------------------------------------
1 | assertTrue(true);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | indent_size = 4
7 | indent_style = space
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
14 | [*.{yml,yaml}]
15 | indent_size = 2
16 |
17 | [docker-compose.yml]
18 | indent_size = 4
19 |
--------------------------------------------------------------------------------
/app/Models/AnnouncementModel.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/app/Http/Middleware/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/app/Models/Products.php:
--------------------------------------------------------------------------------
1 | belongsTo(RoomsModel::class);
19 | }
20 |
21 | }
--------------------------------------------------------------------------------
/app/Models/ExpensesModel.php:
--------------------------------------------------------------------------------
1 | belongsTo(Users::class);
18 | }
19 | }
--------------------------------------------------------------------------------
/app/Models/Product_Balance.php:
--------------------------------------------------------------------------------
1 | belongsTo(Products::class);
17 | }
18 | }
--------------------------------------------------------------------------------
/app/Models/Access_Control.php:
--------------------------------------------------------------------------------
1 | belongsTo(RoomsModel::class);
18 | }
19 | }
--------------------------------------------------------------------------------
/tests/Feature/ExampleTest.php:
--------------------------------------------------------------------------------
1 | get('/');
16 |
17 | $response->assertStatus(200);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | 'current_password',
16 | 'password',
17 | 'password_confirmation',
18 | ];
19 | }
20 |
--------------------------------------------------------------------------------
/tests/CreatesApplication.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class)->bootstrap();
18 |
19 | return $app;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrustHosts.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | public function hosts(): array
15 | {
16 | return [
17 | $this->allSubdomainsOfApplicationUrl(),
18 | ];
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 | expectsJson() ? null : route('login');
16 | }
17 | }
--------------------------------------------------------------------------------
/app/Models/ChatModel.php:
--------------------------------------------------------------------------------
1 | belongsTo(Users::class);
17 | }
18 |
19 | public function isUserOnline()
20 | {
21 | return $this->user->online;
22 | }
23 | }
--------------------------------------------------------------------------------
/app/Models/Payments.php:
--------------------------------------------------------------------------------
1 | belongsTo(RoomsModel::class, 'room_id');
17 | }
18 |
19 | public function user()
20 | {
21 | return $this->belongsTo(Users::class, 'User_ID');
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/app/Models/Customers.php:
--------------------------------------------------------------------------------
1 | belongsTo(Users::class, 'User_ID');
17 | }
18 |
19 | public function room()
20 | {
21 | return $this->belongsTo(RoomsModel::class, 'room_id');
22 | }
23 | }
--------------------------------------------------------------------------------
/app/Http/Middleware/ValidateSignature.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | // 'fbclid',
16 | // 'utm_campaign',
17 | // 'utm_content',
18 | // 'utm_medium',
19 | // 'utm_source',
20 | // 'utm_term',
21 | ];
22 | }
23 |
--------------------------------------------------------------------------------
/database/seeders/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | create();
16 |
17 | // \App\Models\User::factory()->create([
18 | // 'name' => 'Test User',
19 | // 'email' => 'test@example.com',
20 | // ]);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/routes/channels.php:
--------------------------------------------------------------------------------
1 | id === (int) $id;
18 | });
19 |
--------------------------------------------------------------------------------
/routes/api.php:
--------------------------------------------------------------------------------
1 | get('/user', function (Request $request) {
18 | return $request->user();
19 | });
20 |
--------------------------------------------------------------------------------
/app/Http/Middleware/AuthCheck.php:
--------------------------------------------------------------------------------
1 | has('Loginid')){
19 | return redirect('/')->with('fail','You need to login first!');
20 | }
21 | return $next($request);
22 | }
23 | }
--------------------------------------------------------------------------------
/routes/console.php:
--------------------------------------------------------------------------------
1 | comment(Inspiring::quote());
19 | })->purpose('Display an inspiring quote');
20 |
--------------------------------------------------------------------------------
/app/Http/Middleware/CheckWorkerStatus.php:
--------------------------------------------------------------------------------
1 | with('fail', 'You are not a worker!');
21 | }
22 | return $next($request);
23 | }
24 | }
--------------------------------------------------------------------------------
/app/Http/Middleware/CheckAdminStatus.php:
--------------------------------------------------------------------------------
1 | with('fail', 'You are not a admin!');
21 | }
22 | return $next($request);
23 | }
24 | }
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
1 |
2 |
3 | Options -MultiViews -Indexes
4 |
5 |
6 | RewriteEngine On
7 |
8 | # Handle Authorization Header
9 | RewriteCond %{HTTP:Authorization} .
10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
11 |
12 | # Redirect Trailing Slashes If Not A Folder...
13 | RewriteCond %{REQUEST_FILENAME} !-d
14 | RewriteCond %{REQUEST_URI} (.+)/$
15 | RewriteRule ^ %1 [L,R=301]
16 |
17 | # Send Requests To Front Controller...
18 | RewriteCond %{REQUEST_FILENAME} !-d
19 | RewriteCond %{REQUEST_FILENAME} !-f
20 | RewriteRule ^ index.php [L]
21 |
22 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')->hourly();
16 | }
17 |
18 | /**
19 | * Register the commands for the application.
20 | */
21 | protected function commands(): void
22 | {
23 | $this->load(__DIR__.'/Commands');
24 |
25 | require base_path('routes/console.php');
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Providers/AuthServiceProvider.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | protected $policies = [
16 | // 'App\Models\Model' => 'App\Policies\ModelPolicy',
17 | ];
18 |
19 | /**
20 | * Register any authentication / authorization services.
21 | */
22 | public function boot(): void
23 | {
24 | //
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/public/assets/css/spin.css:
--------------------------------------------------------------------------------
1 | @keyframes spinner-line-fade-more {
2 | 0%, 100% {
3 | opacity: 0; /* minimum opacity */
4 | }
5 | 1% {
6 | opacity: 1;
7 | }
8 | }
9 |
10 | @keyframes spinner-line-fade-quick {
11 | 0%, 39%, 100% {
12 | opacity: 0.25; /* minimum opacity */
13 | }
14 | 40% {
15 | opacity: 1;
16 | }
17 | }
18 |
19 | @keyframes spinner-line-fade-default {
20 | 0%, 100% {
21 | opacity: 0.22; /* minimum opacity */
22 | }
23 | 1% {
24 | opacity: 1;
25 | }
26 | }
27 |
28 | @keyframes spinner-line-shrink {
29 | 0%, 25%, 100% {
30 | /* minimum scale and opacity */
31 | transform: scale(0.5);
32 | opacity: 0.25;
33 | }
34 | 26% {
35 | transform: scale(1);
36 | opacity: 1;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/resources/views/mailtemplates/announcement.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Tech Revo Nepal
6 |
7 |
8 |
9 |
10 |
11 | Tech Revo Nepal
12 |
13 | Tech Revo Nepal have new announcement for you.
14 |
15 | Subject: {{$title}}
16 | Announcement: {{$announcement}}
17 |
18 |
19 | Contact us at 9825915122 or techrevonepal@gmail.com if you need any additional support.
20 | Sincerely,
21 | Tech Revo Nepal
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrustProxies.php:
--------------------------------------------------------------------------------
1 | |string|null
14 | */
15 | protected $proxies;
16 |
17 | /**
18 | * The headers that should be used to detect proxies.
19 | *
20 | * @var int
21 | */
22 | protected $headers =
23 | Request::HEADER_X_FORWARDED_FOR |
24 | Request::HEADER_X_FORWARDED_HOST |
25 | Request::HEADER_X_FORWARDED_PORT |
26 | Request::HEADER_X_FORWARDED_PROTO |
27 | Request::HEADER_X_FORWARDED_AWS_ELB;
28 | }
29 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php:
--------------------------------------------------------------------------------
1 | string('email')->primary();
16 | $table->string('token');
17 | $table->timestamp('created_at')->nullable();
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::dropIfExists('password_reset_tokens');
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/2023_03_25_125205_create_rooms_table.php:
--------------------------------------------------------------------------------
1 | id('room_id');
16 | $table->string('room_name');
17 | $table->unsignedBigInteger('User_ID');
18 | $table->foreign('User_ID')->references('User_ID')->on('users');
19 | $table->timestamps();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | */
26 | public function down(): void
27 | {
28 | Schema::dropIfExists('rooms');
29 | }
30 | };
--------------------------------------------------------------------------------
/database/migrations/2023_03_24_132710_create_users_table.php:
--------------------------------------------------------------------------------
1 | id('User_ID');
16 | $table->string('name');
17 | $table->string('email')->unique();
18 | $table->string('password');
19 | $table->string('role');
20 | $table->string('status');
21 | $table->timestamps();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | */
28 | public function down(): void
29 | {
30 | Schema::dropIfExists('users');
31 | }
32 | };
--------------------------------------------------------------------------------
/app/Models/Transactions.php:
--------------------------------------------------------------------------------
1 | belongsTo(RoomsModel::class);
18 | }
19 |
20 | public function user()
21 | {
22 | return $this->belongsTo(Users::class, 'User_ID');
23 | }
24 |
25 | public function customer()
26 | {
27 | return $this->belongsTo(Customers::class);
28 | }
29 |
30 | public function product()
31 | {
32 | return $this->belongsTo(Products::class);
33 | }
34 |
35 | public function payment()
36 | {
37 | return $this->belongsTo(Payments::class);
38 | }
39 | }
--------------------------------------------------------------------------------
/app/Http/Middleware/RedirectIfAuthenticated.php:
--------------------------------------------------------------------------------
1 | check()) {
24 | return redirect(RouteServiceProvider::HOME);
25 | }
26 | }
27 |
28 | return $next($request);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/public/assets/js/hoverable-collapse.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 | 'use strict';
3 | //Open submenu on hover in compact sidebar mode and horizontal menu mode
4 | $(document).on('mouseenter mouseleave', '.sidebar .nav-item', function(ev) {
5 | var body = $('body');
6 | var sidebarIconOnly = body.hasClass("sidebar-icon-only");
7 | var sidebarFixed = body.hasClass("sidebar-fixed");
8 | if (!('ontouchstart' in document.documentElement)) {
9 | if (sidebarIconOnly) {
10 | if (sidebarFixed) {
11 | if (ev.type === 'mouseenter') {
12 | body.removeClass('sidebar-icon-only');
13 | }
14 | } else {
15 | var $menuItem = $(this);
16 | if (ev.type === 'mouseenter') {
17 | $menuItem.addClass('hover-open')
18 | } else {
19 | $menuItem.removeClass('hover-open')
20 | }
21 | }
22 | }
23 | }
24 | });
25 | })(jQuery);
--------------------------------------------------------------------------------
/app/Models/RoomsModel.php:
--------------------------------------------------------------------------------
1 | belongsTo(Users::class, 'User_ID');
17 | }
18 |
19 | public function customers()
20 | {
21 | return $this->hasMany(Customers::class, 'room_id');
22 | }
23 |
24 | public function products()
25 | {
26 | return $this->hasMany(Products::class);
27 | }
28 |
29 |
30 |
31 | public function payments()
32 | {
33 | return $this->hasMany(Payments::class, 'room_id');
34 | }
35 |
36 | public function accessControls()
37 | {
38 | return $this->hasMany(Access_Control::class);
39 | }
40 |
41 | }
--------------------------------------------------------------------------------
/app/Models/Users.php:
--------------------------------------------------------------------------------
1 | hasMany(RoomsModel::class, 'User_ID');
18 | }
19 |
20 |
21 | public function customers()
22 | {
23 | return $this->hasMany(Customers::class, 'User_ID');
24 | }
25 |
26 |
27 | public function payments()
28 | {
29 | return $this->hasMany(Payments::class, 'User_ID');
30 | }
31 |
32 | public function chat()
33 | {
34 | return $this->hasMany(ChatModel::class);
35 | }
36 |
37 | public function setOnlineStatus($status)
38 | {
39 | $this->online = $status;
40 | $this->save();
41 | }
42 |
43 | }
--------------------------------------------------------------------------------
/database/migrations/2023_03_30_060122_create_announcement_table.php:
--------------------------------------------------------------------------------
1 | id('announcement_id');
16 | $table->longText('title');
17 | $table->longText('announcement');
18 | $table->unsignedBigInteger('User_ID');
19 | $table->foreign('User_ID')->references('User_ID')->on('users');
20 | $table->timestamps();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | */
27 | public function down(): void
28 | {
29 | Schema::dropIfExists('announcement');
30 | }
31 | };
--------------------------------------------------------------------------------
/database/migrations/2019_08_19_000000_create_failed_jobs_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('uuid')->unique();
17 | $table->text('connection');
18 | $table->text('queue');
19 | $table->longText('payload');
20 | $table->longText('exception');
21 | $table->timestamp('failed_at')->useCurrent();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | */
28 | public function down(): void
29 | {
30 | Schema::dropIfExists('failed_jobs');
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/database/migrations/2023_03_28_154134_create_expenses_table.php:
--------------------------------------------------------------------------------
1 | id('expenses_id');
16 | $table->string('date');
17 | $table->string('amount');
18 | $table->string('remarks');
19 | $table->unsignedBigInteger('User_ID');
20 | $table->foreign('User_ID')->references('User_ID')->on('users');
21 | $table->timestamps();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | */
28 | public function down(): void
29 | {
30 | Schema::dropIfExists('expenses');
31 | }
32 | };
--------------------------------------------------------------------------------
/database/migrations/2023_03_30_074301_create_chat_table.php:
--------------------------------------------------------------------------------
1 | id('chat_id');
16 | $table->string('name');
17 | $table->string('message');
18 | $table->boolean('online')->default(false)->nullable();
19 | $table->unsignedBigInteger('User_ID');
20 | $table->foreign('User_ID')->references('User_ID')->on('users');
21 | $table->timestamps();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | */
28 | public function down(): void
29 | {
30 | Schema::dropIfExists('chat');
31 | }
32 | };
--------------------------------------------------------------------------------
/config/cors.php:
--------------------------------------------------------------------------------
1 | ['api/*', 'sanctum/csrf-cookie'],
19 |
20 | 'allowed_methods' => ['*'],
21 |
22 | 'allowed_origins' => ['*'],
23 |
24 | 'allowed_origins_patterns' => [],
25 |
26 | 'allowed_headers' => ['*'],
27 |
28 | 'exposed_headers' => [],
29 |
30 | 'max_age' => 0,
31 |
32 | 'supports_credentials' => false,
33 |
34 | ];
35 |
--------------------------------------------------------------------------------
/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->morphs('tokenable');
17 | $table->string('name');
18 | $table->string('token', 64)->unique();
19 | $table->text('abilities')->nullable();
20 | $table->timestamp('last_used_at')->nullable();
21 | $table->timestamp('expires_at')->nullable();
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | */
29 | public function down(): void
30 | {
31 | Schema::dropIfExists('personal_access_tokens');
32 | }
33 | };
34 |
--------------------------------------------------------------------------------
/database/migrations/2023_03_26_102548_create_products_table.php:
--------------------------------------------------------------------------------
1 | id('product_id');
16 | $table->string('product_name');
17 | $table->unsignedBigInteger('room_id');
18 | $table->foreign('room_id')->references('room_id')->on('rooms');
19 | $table->unsignedBigInteger('User_ID');
20 | $table->foreign('User_ID')->references('User_ID')->on('users');
21 | $table->string('date');
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | */
29 | public function down(): void
30 | {
31 | Schema::dropIfExists('products');
32 | }
33 | };
--------------------------------------------------------------------------------
/database/migrations/2023_03_26_124018_create_payments_table.php:
--------------------------------------------------------------------------------
1 | id('payment_id');
16 | $table->string('payment_name');
17 | $table->unsignedBigInteger('room_id');
18 | $table->foreign('room_id')->references('room_id')->on('rooms');
19 | $table->unsignedBigInteger('User_ID');
20 | $table->foreign('User_ID')->references('User_ID')->on('users');
21 | $table->string('date');
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | */
29 | public function down(): void
30 | {
31 | Schema::dropIfExists('payments');
32 | }
33 | };
--------------------------------------------------------------------------------
/app/Providers/EventServiceProvider.php:
--------------------------------------------------------------------------------
1 | >
16 | */
17 | protected $listen = [
18 | Registered::class => [
19 | SendEmailVerificationNotification::class,
20 | ],
21 | ];
22 |
23 | /**
24 | * Register any events for your application.
25 | */
26 | public function boot(): void
27 | {
28 | //
29 | }
30 |
31 | /**
32 | * Determine if events and listeners should be automatically discovered.
33 | */
34 | public function shouldDiscoverEvents(): bool
35 | {
36 | return false;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/database/migrations/2023_03_28_053913_create_access_control_table.php:
--------------------------------------------------------------------------------
1 | id('access_id');
16 | $table->string('date');
17 | $table->string('status')->nullable();
18 | $table->unsignedBigInteger('room_id');
19 | $table->foreign('room_id')->references('room_id')->on('rooms');
20 | $table->unsignedBigInteger('User_ID');
21 | $table->foreign('User_ID')->references('User_ID')->on('users');
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | */
29 | public function down(): void
30 | {
31 | Schema::dropIfExists('access_control');
32 | }
33 | };
--------------------------------------------------------------------------------
/app/Models/User.php:
--------------------------------------------------------------------------------
1 |
19 | */
20 | protected $fillable = [
21 | 'name',
22 | 'email',
23 | 'password',
24 | ];
25 |
26 | /**
27 | * The attributes that should be hidden for serialization.
28 | *
29 | * @var array
30 | */
31 | protected $hidden = [
32 | 'password',
33 | 'remember_token',
34 | ];
35 |
36 | /**
37 | * The attributes that should be cast.
38 | *
39 | * @var array
40 | */
41 | protected $casts = [
42 | 'email_verified_at' => 'datetime',
43 | ];
44 | }
45 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21 | 'scheme' => 'https',
22 | ],
23 |
24 | 'postmark' => [
25 | 'token' => env('POSTMARK_TOKEN'),
26 | ],
27 |
28 | 'ses' => [
29 | 'key' => env('AWS_ACCESS_KEY_ID'),
30 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
31 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
32 | ],
33 |
34 | ];
35 |
--------------------------------------------------------------------------------
/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 |
10 | */
11 | class UserFactory extends Factory
12 | {
13 | /**
14 | * Define the model's default state.
15 | *
16 | * @return array
17 | */
18 | public function definition(): array
19 | {
20 | return [
21 | 'name' => fake()->name(),
22 | 'email' => fake()->unique()->safeEmail(),
23 | 'email_verified_at' => now(),
24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
25 | 'remember_token' => Str::random(10),
26 | ];
27 | }
28 |
29 | /**
30 | * Indicate that the model's email address should be unverified.
31 | */
32 | public function unverified(): static
33 | {
34 | return $this->state(fn (array $attributes) => [
35 | 'email_verified_at' => null,
36 | ]);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/Http/Controllers/roomcontroller.php:
--------------------------------------------------------------------------------
1 | validate(
18 | [
19 | 'name'=>'required'
20 | ]
21 | );
22 |
23 | $room= new RoomsModel;
24 | $room->room_name=$request['name'];
25 | $room->User_ID=$request['User_ID'];
26 | $room->save();
27 | if($room){
28 | return back()->with('success','You have successfully created the room');
29 | }
30 | else
31 | {
32 | return back()->with('fail','The error occurred');
33 | }
34 |
35 | }
36 |
37 | public function roomajax(){
38 | $rooms = Room::select('room_id', 'room_name', 'name')
39 | ->join('users', 'rooms.User_ID', '=', 'users.User_ID')
40 | ->get();
41 |
42 |
43 | }
44 | }
--------------------------------------------------------------------------------
/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('views'),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => env(
32 | 'VIEW_COMPILED_PATH',
33 | realpath(storage_path('framework/views'))
34 | ),
35 |
36 | ];
37 |
--------------------------------------------------------------------------------
/database/migrations/2023_03_29_071655_create_clock_table.php:
--------------------------------------------------------------------------------
1 | id('clock_id');
16 | $table->string('checkin')->nullable();
17 | $table->string('checkout')->nullable();
18 | $table->string('status');
19 | $table->string('currentstatus')->nullable();
20 | $table->string('date');
21 | $table->unsignedBigInteger('room_id');
22 | $table->foreign('room_id')->references('room_id')->on('rooms');
23 | $table->unsignedBigInteger('User_ID');
24 | $table->foreign('User_ID')->references('User_ID')->on('users');
25 | $table->timestamps();
26 | });
27 | }
28 |
29 | /**
30 | * Reverse the migrations.
31 | */
32 | public function down(): void
33 | {
34 | Schema::dropIfExists('clock');
35 | }
36 | };
--------------------------------------------------------------------------------
/database/migrations/2023_03_26_040032_create_customers_table.php:
--------------------------------------------------------------------------------
1 | id('customer_id');
16 | $table->string('customer_name');
17 | $table->string('facebook_link');
18 | $table->string('email')->nullable();
19 | $table->string('phone')->nullable();
20 | $table->string('date');
21 | $table->unsignedBigInteger('User_ID');
22 | $table->foreign('User_ID')->references('User_ID')->on('users');
23 | $table->unsignedBigInteger('room_id');
24 | $table->foreign('room_id')->references('room_id')->on('rooms');
25 | $table->timestamps();
26 | });
27 | }
28 |
29 | /**
30 | * Reverse the migrations.
31 | */
32 | public function down(): void
33 | {
34 | Schema::dropIfExists('customers');
35 | }
36 | };
--------------------------------------------------------------------------------
/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | , \Psr\Log\LogLevel::*>
14 | */
15 | protected $levels = [
16 | //
17 | ];
18 |
19 | /**
20 | * A list of the exception types that are not reported.
21 | *
22 | * @var array>
23 | */
24 | protected $dontReport = [
25 | //
26 | ];
27 |
28 | /**
29 | * A list of the inputs that are never flashed to the session on validation exceptions.
30 | *
31 | * @var array
32 | */
33 | protected $dontFlash = [
34 | 'current_password',
35 | 'password',
36 | 'password_confirmation',
37 | ];
38 |
39 | /**
40 | * Register the exception handling callbacks for the application.
41 | */
42 | public function register(): void
43 | {
44 | $this->reportable(function (Throwable $e) {
45 | //
46 | });
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | ./tests/Unit
10 |
11 |
12 | ./tests/Feature
13 |
14 |
15 |
16 |
17 | ./app
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/database/migrations/2023_03_27_121435_create_payment_balance_table.php:
--------------------------------------------------------------------------------
1 | id('cash_id');
16 | $table->bigInteger('cash_balance');
17 | $table->string('status');
18 | $table->string('date');
19 | $table->unsignedBigInteger('room_id');
20 | $table->foreign('room_id')->references('room_id')->on('rooms');
21 | $table->unsignedBigInteger('User_ID');
22 | $table->foreign('User_ID')->references('User_ID')->on('users');
23 | $table->unsignedBigInteger('payment_id');
24 | $table->foreign('payment_id')->references('payment_id')->on('payments');
25 | $table->timestamps();
26 | });
27 | }
28 |
29 | /**
30 | * Reverse the migrations.
31 | */
32 | public function down(): void
33 | {
34 | Schema::dropIfExists('payment_balance');
35 | }
36 | };
--------------------------------------------------------------------------------
/database/migrations/2023_03_27_122702_create_product_balance_table.php:
--------------------------------------------------------------------------------
1 | id('credit_id');
16 | $table->bigInteger('credit_balance');
17 | $table->string('status');
18 | $table->string('date');
19 | $table->unsignedBigInteger('room_id');
20 | $table->foreign('room_id')->references('room_id')->on('rooms');
21 | $table->unsignedBigInteger('User_ID');
22 | $table->foreign('User_ID')->references('User_ID')->on('users');
23 | $table->unsignedBigInteger('product_id');
24 | $table->foreign('product_id')->references('product_id')->on('products');
25 | $table->timestamps();
26 | });
27 | }
28 |
29 | /**
30 | * Reverse the migrations.
31 | */
32 | public function down(): void
33 | {
34 | Schema::dropIfExists('product_balance');
35 | }
36 | };
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | APP_NAME=Laravel
2 | APP_ENV=local
3 | APP_KEY=
4 | APP_DEBUG=true
5 | APP_URL=http://localhost
6 |
7 | LOG_CHANNEL=stack
8 | LOG_DEPRECATIONS_CHANNEL=null
9 | LOG_LEVEL=debug
10 |
11 | DB_CONNECTION=mysql
12 | DB_HOST=127.0.0.1
13 | DB_PORT=3306
14 | DB_DATABASE=laravel
15 | DB_USERNAME=root
16 | DB_PASSWORD=
17 |
18 | BROADCAST_DRIVER=log
19 | CACHE_DRIVER=file
20 | FILESYSTEM_DISK=local
21 | QUEUE_CONNECTION=sync
22 | SESSION_DRIVER=file
23 | SESSION_LIFETIME=120
24 |
25 | MEMCACHED_HOST=127.0.0.1
26 |
27 | REDIS_HOST=127.0.0.1
28 | REDIS_PASSWORD=null
29 | REDIS_PORT=6379
30 |
31 | MAIL_MAILER=smtp
32 | MAIL_HOST=mailpit
33 | MAIL_PORT=1025
34 | MAIL_USERNAME=null
35 | MAIL_PASSWORD=null
36 | MAIL_ENCRYPTION=null
37 | MAIL_FROM_ADDRESS="hello@example.com"
38 | MAIL_FROM_NAME="${APP_NAME}"
39 |
40 | AWS_ACCESS_KEY_ID=
41 | AWS_SECRET_ACCESS_KEY=
42 | AWS_DEFAULT_REGION=us-east-1
43 | AWS_BUCKET=
44 | AWS_USE_PATH_STYLE_ENDPOINT=false
45 |
46 | PUSHER_APP_ID=
47 | PUSHER_APP_KEY=
48 | PUSHER_APP_SECRET=
49 | PUSHER_HOST=
50 | PUSHER_PORT=443
51 | PUSHER_SCHEME=https
52 | PUSHER_APP_CLUSTER=mt1
53 |
54 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
55 | VITE_PUSHER_HOST="${PUSHER_HOST}"
56 | VITE_PUSHER_PORT="${PUSHER_PORT}"
57 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
58 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
59 |
--------------------------------------------------------------------------------
/resources/js/bootstrap.js:
--------------------------------------------------------------------------------
1 | /**
2 | * We'll load the axios HTTP library which allows us to easily issue requests
3 | * to our Laravel back-end. This library automatically handles sending the
4 | * CSRF token as a header based on the value of the "XSRF" token cookie.
5 | */
6 |
7 | import axios from 'axios';
8 | window.axios = axios;
9 |
10 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
11 |
12 | /**
13 | * Echo exposes an expressive API for subscribing to channels and listening
14 | * for events that are broadcast by Laravel. Echo and event broadcasting
15 | * allows your team to easily build robust real-time web applications.
16 | */
17 |
18 | // import Echo from 'laravel-echo';
19 |
20 | // import Pusher from 'pusher-js';
21 | // window.Pusher = Pusher;
22 |
23 | // window.Echo = new Echo({
24 | // broadcaster: 'pusher',
25 | // key: import.meta.env.VITE_PUSHER_APP_KEY,
26 | // cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1',
27 | // wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
28 | // wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
29 | // wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
30 | // forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
31 | // enabledTransports: ['ws', 'wss'],
32 | // });
33 |
--------------------------------------------------------------------------------
/public/assets/js/dashboard.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 | 'use strict';
3 | $(function() {
4 |
5 |
6 |
7 | var table = $('#example').DataTable( {
8 | "ajax": "js/data.txt",
9 | "columns": [
10 | { "data": "Quote" },
11 | { "data": "Product" },
12 | { "data": "Business" },
13 | { "data": "Policy" },
14 | { "data": "Premium" },
15 | { "data": "Status" },
16 | { "data": "Updated" },
17 | {
18 | "className": 'details-control',
19 | "orderable": false,
20 | "data": null,
21 | "defaultContent": ''
22 | }
23 | ],
24 | "order": [[1, 'asc']],
25 | "paging": false,
26 | "ordering": true,
27 | "info": false,
28 | "filter": false,
29 | columnDefs: [{
30 | orderable: false,
31 | className: 'select-checkbox',
32 | targets: 0
33 | }],
34 | select: {
35 | style: 'os',
36 | selector: 'td:first-child'
37 | }
38 | } );
39 | $('#example tbody').on('click', 'td.details-control', function () {
40 | var tr = $(this).closest('tr');
41 | var row = table.row( tr );
42 |
43 | if ( row.child.isShown() ) {
44 | // This row is already open - close it
45 | row.child.hide();
46 | tr.removeClass('shown');
47 | }
48 | else {
49 | // Open this row
50 | row.child( format(row.data()) ).show();
51 | tr.addClass('shown');
52 | }
53 | } );
54 |
55 | });
56 | })(jQuery);
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | configureRateLimiting();
28 |
29 | $this->routes(function () {
30 | Route::middleware('api')
31 | ->prefix('api')
32 | ->group(base_path('routes/api.php'));
33 |
34 | Route::middleware('web')
35 | ->group(base_path('routes/web.php'));
36 | });
37 | }
38 |
39 | /**
40 | * Configure the rate limiters for the application.
41 | */
42 | protected function configureRateLimiting(): void
43 | {
44 | RateLimiter::for('api', function (Request $request) {
45 | return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
46 | });
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/Http/Controllers/paymentcontroller.php:
--------------------------------------------------------------------------------
1 | get();
16 |
17 | return view('admin/create_payments',compact('rooms'));
18 | }
19 |
20 | public function insertdata(Request $request){
21 |
22 | $request->validate([
23 | 'payment_name'=>'required',
24 |
25 | ]);
26 |
27 | $payment= new Payments;
28 | $payment->payment_name=$request['payment_name'];
29 | $payment->date=$request['date'];
30 | $payment->room_id=$request['room_id'];
31 | $payment->User_ID=$request['User_ID'];
32 | $payment->save();
33 | if($payment){
34 | return back()->with('success','You have successfully created the payment');
35 | }
36 | else
37 | {
38 | return back()->with('fail','The error occurred');
39 | }
40 |
41 | }
42 |
43 | public function getpaymenttable(){
44 |
45 | $payments = Payments::with('room', 'user')->get();
46 |
47 | return response()->json(['data' =>$payments]);
48 | }
49 |
50 | public function viewpayments(){
51 | return view('admin/view_payments');
52 | }
53 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/expensescontroller.php:
--------------------------------------------------------------------------------
1 | validate(
18 | [
19 | 'date'=>'required',
20 | 'remarks'=>'required',
21 | 'amount'=>'required'
22 | ]
23 | );
24 |
25 | $expenses= new ExpensesModel;
26 | $expenses->date=$request['date'];
27 | $expenses->remarks=$request['remarks'];
28 | $expenses->amount=$request['amount'];
29 | $expenses->User_ID=$request['User_ID'];
30 | $expenses->save();
31 | if($expenses){
32 | return back()->with('success','You have successfully save the expenses detail');
33 | }
34 | else
35 | {
36 | return back()->with('fail','The error occurred');
37 | }
38 |
39 | }
40 |
41 |
42 | public function getexpenses(){
43 |
44 |
45 | $expesnestable = ExpensesModel::join('users', 'users.User_ID', '=', 'expenses.User_ID')
46 | ->select('expenses.expenses_id', 'expenses.date', 'expenses.amount','expenses.remarks','users.name')
47 | ->get();
48 |
49 |
50 | return response()->json(['data' => $expesnestable]);
51 | }
52 | }
--------------------------------------------------------------------------------
/database/migrations/2023_03_27_090624_create_transactions_table.php:
--------------------------------------------------------------------------------
1 | id('transaction_id');
17 | $table->string('type');
18 | $table->string('note');
19 | $table->string('sender_receiver');
20 | $table->bigInteger('cash');
21 | $table->bigInteger('Credit');
22 | $table->string('date');
23 | $table->string('cash_identifier');
24 | $table->unsignedBigInteger('room_id');
25 | $table->foreign('room_id')->references('room_id')->on('rooms');
26 | $table->unsignedBigInteger('User_ID');
27 | $table->foreign('User_ID')->references('User_ID')->on('users');
28 | $table->unsignedBigInteger('customer_id');
29 | $table->foreign('customer_id')->references('customer_id')->on('customers');
30 | $table->unsignedBigInteger('product_id');
31 | $table->foreign('product_id')->references('product_id')->on('products');
32 | $table->unsignedBigInteger('payment_id');
33 | $table->foreign('payment_id')->references('payment_id')->on('payments');
34 | $table->timestamps();
35 | });
36 | }
37 |
38 | /**
39 | * Reverse the migrations.
40 | */
41 | public function down(): void
42 | {
43 | Schema::dropIfExists('transactions');
44 | }
45 | };
--------------------------------------------------------------------------------
/config/hashing.php:
--------------------------------------------------------------------------------
1 | 'bcrypt',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Bcrypt Options
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may specify the configuration options that should be used when
26 | | passwords are hashed using the Bcrypt algorithm. This will allow you
27 | | to control the amount of time it takes to hash the given password.
28 | |
29 | */
30 |
31 | 'bcrypt' => [
32 | 'rounds' => env('BCRYPT_ROUNDS', 10),
33 | ],
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Argon Options
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may specify the configuration options that should be used when
41 | | passwords are hashed using the Argon algorithm. These will allow you
42 | | to control the amount of time it takes to hash the given password.
43 | |
44 | */
45 |
46 | 'argon' => [
47 | 'memory' => 65536,
48 | 'threads' => 1,
49 | 'time' => 4,
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/app/Http/Controllers/admincontroller.php:
--------------------------------------------------------------------------------
1 | first();
23 | Session::put('User_ID',$data->User_ID);
24 | Session::put('name',$data->name);
25 | Session::put('email',$data->email);
26 |
27 | }
28 | $viewchat=ChatModel::orderBy('chat_id','desc')->limit(3)->get();
29 | $workerCount = Users::where('role', '=', 'Worker')->count();
30 | $countrooms=RoomsModel::count();
31 | $countcustomer=Customers::count();
32 | $totalAmount = ExpensesModel::sum('amount');
33 | $countproducts=Products::count();
34 | $counttransactions=Transactions::count();
35 | $customers = Customers::select('date', DB::raw('count(*) as count'))
36 | ->groupBy('date')
37 | ->orderBy('date')
38 | ->pluck('count', 'date');
39 |
40 |
41 | return view('admin/dashboard',compact('viewchat',
42 | 'workerCount','countrooms','countcustomer','totalAmount','countproducts','counttransactions','customers'));
43 | }
44 |
45 | public function logout(){
46 | if(Session::has('Loginid')){
47 | Session::pull('Loginid');
48 | return redirect('/');
49 | }
50 |
51 |
52 | }
53 | }
--------------------------------------------------------------------------------
/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 |
55 | return $app;
56 |
--------------------------------------------------------------------------------
/app/Http/Controllers/productcontroller.php:
--------------------------------------------------------------------------------
1 | get();
16 |
17 |
18 | return view('admin/create_products',compact('rooms'));
19 | }
20 |
21 | public function insertdata(Request $request){
22 |
23 | $request->validate([
24 | 'product_name'=>'required',
25 |
26 |
27 | ]);
28 |
29 | $product= new Products;
30 | $product->product_name=$request['product_name'];
31 | $product->date=$request['date'];
32 | $product->room_id=$request['room_id'];
33 | $product->User_ID=$request['User_ID'];
34 | $product->save();
35 | if($product){
36 | return back()->with('success','You have successfully created the product');
37 | }
38 | else
39 | {
40 | return back()->with('fail','The error occurred');
41 | }
42 |
43 | }
44 |
45 | public function getProductsAndRooms()
46 | {
47 | $products = DB::table('products')
48 | ->leftJoin('rooms', 'products.room_id', '=', 'rooms.room_id')
49 | ->select('products.product_id', 'products.product_name', 'products.room_id', 'products.date', 'rooms.room_name')
50 | ->get();
51 |
52 |
53 | return response()->json(['data' =>$products]);
54 | }
55 |
56 | public function viewproducts(){
57 |
58 | return view('admin/view_products');
59 |
60 | }
61 |
62 |
63 |
64 |
65 |
66 |
67 | }
--------------------------------------------------------------------------------
/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/app/Http/Controllers/customercontroller.php:
--------------------------------------------------------------------------------
1 | get();
15 |
16 |
17 | return view('admin/createcustomers',compact('rooms'));
18 | }
19 |
20 | public function insertdata(Request $request){
21 |
22 | $request->validate(
23 | [
24 | 'name'=>'required',
25 | 'facebook_link'=>'required',
26 | 'room_id'=>'required',
27 | ]
28 | );
29 |
30 | $customer= new Customers;
31 | $customer->customer_name=$request['name'];
32 | $customer->email=$request['email'];
33 | $customer->facebook_link=$request['facebook_link'];
34 | $customer->phone=$request['mobile'];
35 | $customer->date=$request['date'];
36 | $customer->room_id=$request['room_id'];
37 | $customer->User_ID=$request['User_ID'];
38 | $customer->save();
39 | if($customer){
40 | return back()->with('success','You have successfully created the customer');
41 | }
42 | else
43 | {
44 | return back()->with('fail','The error occurred');
45 | }
46 |
47 |
48 |
49 |
50 | }
51 |
52 | public function getCustomers()
53 | {
54 | $customers = Customers::with('room', 'user')->get();
55 |
56 | return response()->json(['data' => $customers]);
57 |
58 | }
59 |
60 | public function viewcustomer(){
61 |
62 | return view('admin/viewcustomers');
63 | }
64 |
65 |
66 | }
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class);
50 |
51 | $response = $kernel->handle(
52 | $request = Request::capture()
53 | )->send();
54 |
55 | $kernel->terminate($request, $response);
56 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel/laravel",
3 | "type": "project",
4 | "description": "The Laravel Framework.",
5 | "keywords": ["framework", "laravel"],
6 | "license": "MIT",
7 | "require": {
8 | "php": "^8.1",
9 | "guzzlehttp/guzzle": "^7.2",
10 | "laravel/framework": "^10.0",
11 | "laravel/sanctum": "^3.2",
12 | "laravel/tinker": "^2.8"
13 | },
14 | "require-dev": {
15 | "fakerphp/faker": "^1.9.1",
16 | "laravel/pint": "^1.0",
17 | "laravel/sail": "^1.18",
18 | "mockery/mockery": "^1.4.4",
19 | "nunomaduro/collision": "^7.0",
20 | "phpunit/phpunit": "^10.0",
21 | "spatie/laravel-ignition": "^2.0"
22 | },
23 | "autoload": {
24 | "psr-4": {
25 | "App\\": "app/",
26 | "Database\\Factories\\": "database/factories/",
27 | "Database\\Seeders\\": "database/seeders/"
28 | }
29 | },
30 | "autoload-dev": {
31 | "psr-4": {
32 | "Tests\\": "tests/"
33 | }
34 | },
35 | "scripts": {
36 | "post-autoload-dump": [
37 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
38 | "@php artisan package:discover --ansi"
39 | ],
40 | "post-update-cmd": [
41 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
42 | ],
43 | "post-root-package-install": [
44 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
45 | ],
46 | "post-create-project-cmd": [
47 | "@php artisan key:generate --ansi"
48 | ]
49 | },
50 | "extra": {
51 | "laravel": {
52 | "dont-discover": []
53 | }
54 | },
55 | "config": {
56 | "optimize-autoloader": true,
57 | "preferred-install": "dist",
58 | "sort-packages": true,
59 | "allow-plugins": {
60 | "pestphp/pest-plugin": true,
61 | "php-http/discovery": true
62 | }
63 | },
64 | "minimum-stability": "stable",
65 | "prefer-stable": true
66 | }
67 |
--------------------------------------------------------------------------------
/app/Http/Controllers/chatcontroller.php:
--------------------------------------------------------------------------------
1 | get();
16 |
17 | return view('admin/chat',compact('viewchat'));
18 | }
19 |
20 | public function workerchat(){
21 |
22 | $user_id = session('User_ID');
23 |
24 | $countrooms = Access_Control::where('User_ID', $user_id)->count();
25 |
26 | $access_controls2 = DB::table('rooms')
27 | ->join('access_control', 'rooms.room_id', '=', 'access_control.room_id')
28 | ->select('rooms.room_name','rooms.room_id')
29 | ->where('access_control.User_ID', '=', $user_id)
30 | ->where('access_control.status', '=', DB::raw('rooms.room_id'))
31 | ->get();
32 |
33 | $access_controls = DB::table('access_control')
34 | ->join('rooms', 'access_control.room_id', '=', 'rooms.room_id')
35 | ->where('access_control.User_ID', $user_id)
36 | ->select('access_control.User_ID', 'access_control.status', 'rooms.room_name','access_control.room_id')
37 | ->get();
38 |
39 | $viewchat=ChatModel::orderBy('chat_id','desc')->get();
40 |
41 | return view('workers/chat',compact('viewchat','access_controls2','countrooms','access_controls'));
42 | }
43 |
44 |
45 | public function insertchat(Request $request){
46 | $request->validate([
47 |
48 | 'message'=>'required'
49 |
50 | ]);
51 |
52 |
53 | $chat=new ChatModel;
54 | $chat->name=$request['name'];
55 | $chat->message=$request['message'];
56 | $chat->User_ID=$request['User_ID'];
57 | $chat->save();
58 | if ($chat){
59 |
60 | return back();
61 |
62 | }
63 | else{
64 | return back();
65 | }
66 |
67 | }
68 |
69 |
70 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/logincontroller.php:
--------------------------------------------------------------------------------
1 | validate([
20 | 'email1' => 'required|email',
21 | 'password1' => 'required',
22 | ]);
23 |
24 | $credentials = $request->only('email1', 'password1');
25 | $user = Users::where('email', $credentials['email1'])->first();
26 |
27 |
28 | if (!$user) {
29 | return back()->with('fail','The user not found');
30 | }
31 |
32 | if ($user->status=='Inactive'){
33 |
34 | return back()->with('fail','The user account is deleted already');
35 |
36 | }
37 | // Check the hashing password and validate
38 | if (!Hash::check($credentials['password1'], $user->password)) {
39 | return back()->with('fail','The password does not match');
40 | }
41 |
42 | // set the user role based on email and password provided
43 | if ($user->email === $credentials['email1'] && $user->role == 'Admin') {
44 | $request->session()->put('Loginid',$user->User_ID);
45 | $request->session()->put('role',$user->role);
46 | return redirect('/admin/dashboard');
47 |
48 |
49 |
50 | } elseif ($user->email === $credentials['email1'] && $user->role == 'Worker') {
51 |
52 | $request->session()->put('Loginid',$user->User_ID);
53 | $request->session()->put('role',$user->role);
54 | return redirect('/worker/dashboard')->with('success','Welcome Worker');
55 |
56 |
57 |
58 | }
59 |
60 |
61 | else {
62 | return back()->with('fail','The provided email and password does not have a valid role');
63 | }
64 |
65 | Auth::login($user);
66 | return redirect()->intended('/dashboard');
67 | }
68 |
69 |
70 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/announcementcontroller.php:
--------------------------------------------------------------------------------
1 | validate([
28 | 'title'=>'required',
29 | 'announcement'=>'required'
30 | ]);
31 |
32 | // $data = [
33 | // 'announcement' => $request->announcement,
34 | // 'title' => $request->title,
35 | // ];
36 |
37 | // $recipients = [
38 | // 'hanciewanemphago@gmail.com',
39 | // 'nitesh0hamal@gmail.com',
40 |
41 | // ];
42 |
43 | // foreach ($recipients as $recipient) {
44 | // Mail::send('mailtemplates/announcement', $data, function($message) use ($recipient, $data) {
45 | // $message->to($recipient);
46 | // $message->subject($data['title']);
47 | // });
48 | // }
49 |
50 |
51 | $announce= new AnnouncementModel;
52 | $announce->title=$request['title'];
53 | $announce->announcement=$request['announcement'];
54 | $announce->User_ID=$request['User_ID'];
55 | $announce->save();
56 | if($announce){
57 | return back()->with('success','You have successfully done the announcement to all workers');
58 | }
59 | else
60 | {
61 | return back()->with('fail','The error occurred');
62 | }
63 |
64 | }
65 |
66 |
67 | public function deletedata($id){
68 |
69 | $announce=AnnouncementModel::find($id);
70 | if(!is_null($announce)){
71 | $announce->delete();
72 | return back()->with('success',"The announcement is deleted successfully");
73 | }
74 | else{
75 | return back()->with('fail',"Error Occurred");
76 | }
77 |
78 | }
79 | }
--------------------------------------------------------------------------------
/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
40 | 'port' => env('PUSHER_PORT', 443),
41 | 'scheme' => env('PUSHER_SCHEME', 'https'),
42 | 'encrypted' => true,
43 | 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
44 | ],
45 | 'client_options' => [
46 | // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
47 | ],
48 | ],
49 |
50 | 'ably' => [
51 | 'driver' => 'ably',
52 | 'key' => env('ABLY_KEY'),
53 | ],
54 |
55 | 'redis' => [
56 | 'driver' => 'redis',
57 | 'connection' => 'default',
58 | ],
59 |
60 | 'log' => [
61 | 'driver' => 'log',
62 | ],
63 |
64 | 'null' => [
65 | 'driver' => 'null',
66 | ],
67 |
68 | ],
69 |
70 | ];
71 |
--------------------------------------------------------------------------------
/config/sanctum.php:
--------------------------------------------------------------------------------
1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
19 | '%s%s',
20 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
21 | Sanctum::currentApplicationUrlWithPort()
22 | ))),
23 |
24 | /*
25 | |--------------------------------------------------------------------------
26 | | Sanctum Guards
27 | |--------------------------------------------------------------------------
28 | |
29 | | This array contains the authentication guards that will be checked when
30 | | Sanctum is trying to authenticate a request. If none of these guards
31 | | are able to authenticate the request, Sanctum will use the bearer
32 | | token that's present on an incoming request for authentication.
33 | |
34 | */
35 |
36 | 'guard' => ['web'],
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Expiration Minutes
41 | |--------------------------------------------------------------------------
42 | |
43 | | This value controls the number of minutes until an issued token will be
44 | | considered expired. If this value is null, personal access tokens do
45 | | not expire. This won't tweak the lifetime of first-party sessions.
46 | |
47 | */
48 |
49 | 'expiration' => null,
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | Sanctum Middleware
54 | |--------------------------------------------------------------------------
55 | |
56 | | When authenticating your first-party SPA with Sanctum you may need to
57 | | customize some of the middleware Sanctum uses while processing the
58 | | request. You may change the middleware listed below as required.
59 | |
60 | */
61 |
62 | 'middleware' => [
63 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
64 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
65 | ],
66 |
67 | ];
68 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DISK', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Filesystem Disks
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure as many filesystem "disks" as you wish, and you
24 | | may even configure multiple disks of the same driver. Defaults have
25 | | been set up for each driver as an example of the required values.
26 | |
27 | | Supported Drivers: "local", "ftp", "sftp", "s3"
28 | |
29 | */
30 |
31 | 'disks' => [
32 |
33 | 'local' => [
34 | 'driver' => 'local',
35 | 'root' => storage_path('app'),
36 | 'throw' => false,
37 | ],
38 |
39 | 'public' => [
40 | 'driver' => 'local',
41 | 'root' => storage_path('app/public'),
42 | 'url' => env('APP_URL').'/storage',
43 | 'visibility' => 'public',
44 | 'throw' => false,
45 | ],
46 |
47 | 's3' => [
48 | 'driver' => 's3',
49 | 'key' => env('AWS_ACCESS_KEY_ID'),
50 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
51 | 'region' => env('AWS_DEFAULT_REGION'),
52 | 'bucket' => env('AWS_BUCKET'),
53 | 'url' => env('AWS_URL'),
54 | 'endpoint' => env('AWS_ENDPOINT'),
55 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
56 | 'throw' => false,
57 | ],
58 |
59 | ],
60 |
61 | /*
62 | |--------------------------------------------------------------------------
63 | | Symbolic Links
64 | |--------------------------------------------------------------------------
65 | |
66 | | Here you may configure the symbolic links that will be created when the
67 | | `storage:link` Artisan command is executed. The array keys should be
68 | | the locations of the links and the values should be their targets.
69 | |
70 | */
71 |
72 | 'links' => [
73 | public_path('storage') => storage_path('app/public'),
74 | ],
75 |
76 | ];
77 |
--------------------------------------------------------------------------------
/app/Http/Controllers/userscontroller.php:
--------------------------------------------------------------------------------
1 | validate([
15 | 'name' => 'required|string|max:255',
16 | 'email' => 'required',
17 | 'password' => 'required',
18 | 'role' => 'required|string|in:Admin,Worker',
19 | 'status' => 'required|string|in:Active',
20 | ]);
21 |
22 | //insert query
23 | $admin=new Users;
24 | $admin->name=$request['name'];
25 | $admin->email=$request['email'];
26 | $admin->role=$request['role'];
27 | $admin->status=$request['status'];
28 | $admin->password=Hash::make($request['password']);
29 | $admin->save();
30 | if($admin){
31 | return back()->with('success','You have registered successfully');
32 | }
33 | else {
34 | return back()->with('fail','Something wrong');
35 | }
36 |
37 | }
38 |
39 |
40 | public function insertworkeraccount(Request $request)
41 | {
42 | $request->validate([
43 | 'name' => 'required|string|max:255',
44 | 'email' => 'required|email',
45 | 'password' => 'required',
46 | 'role' => 'required|string|in:Worker',
47 | 'status' => 'required|string|in:Active',
48 | ]);
49 |
50 | //insert query
51 | $admin=new Users;
52 | $admin->name=$request['name'];
53 | $admin->email=$request['email'];
54 | $admin->role=$request['role'];
55 | $admin->status=$request['status'];
56 | $admin->password=Hash::make($request['password']);
57 | $admin->save();
58 | if($admin){
59 | return back()->with('success','You have registered successfully');
60 | }
61 | else {
62 | return back()->with('fail','Something wrong');
63 | }
64 |
65 | }
66 |
67 | public function workeraccounts(){
68 |
69 | $data = Users::all();
70 |
71 |
72 |
73 | return view('admin/createworkeraccounts');
74 | }
75 |
76 | public function workerdata(){
77 | $data = Users::where('role', 'Worker')->get();
78 |
79 | $output = array();
80 | foreach ($data as $row) {
81 | $output[] = array(
82 | 'User_ID' => $row->User_ID,
83 | 'name' => $row->name,
84 | 'email' => $row->email
85 | );
86 | }
87 |
88 | return response()->json(array('data' => $output));
89 | }
90 | }
--------------------------------------------------------------------------------
/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | protected $middleware = [
17 | // \App\Http\Middleware\TrustHosts::class,
18 | \App\Http\Middleware\TrustProxies::class,
19 | \Illuminate\Http\Middleware\HandleCors::class,
20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
22 | \App\Http\Middleware\TrimStrings::class,
23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
24 | ];
25 |
26 | /**
27 | * The application's route middleware groups.
28 | *
29 | * @var array>
30 | */
31 | protected $middlewareGroups = [
32 | 'web' => [
33 | \App\Http\Middleware\EncryptCookies::class,
34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
35 | \Illuminate\Session\Middleware\StartSession::class,
36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
37 | \App\Http\Middleware\VerifyCsrfToken::class,
38 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
39 | ],
40 |
41 | 'api' => [
42 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
43 | \Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
44 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
45 | ],
46 | ];
47 |
48 | /**
49 | * The application's middleware aliases.
50 | *
51 | * Aliases may be used to conveniently assign middleware to routes and groups.
52 | *
53 | * @var array
54 | */
55 | protected $middlewareAliases = [
56 | 'adminstatus' => \App\Http\Middleware\CheckAdminStatus::class,
57 | 'workerstatus' => \App\Http\Middleware\CheckWorkerStatus::class,
58 | 'isLoggedIn' => \App\Http\Middleware\AuthCheck::class,
59 | 'auth' => \App\Http\Middleware\Authenticate::class,
60 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
61 | 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
62 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
63 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
64 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
65 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
66 | 'signed' => \App\Http\Middleware\ValidateSignature::class,
67 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
68 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
69 | ];
70 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/accesscontroller.php:
--------------------------------------------------------------------------------
1 | get(['User_ID','name']);
16 | $rooms = RoomsModel::select('room_id', 'room_name')->get();
17 |
18 |
19 | return view('admin/access_control',compact('users','rooms'));
20 | }
21 |
22 |
23 | public function insertdata(Request $request){
24 |
25 | $request->validate(
26 |
27 | [
28 |
29 | 'room_name'=>'required',
30 | 'worker_name'=>'required',
31 |
32 | ]
33 | );
34 |
35 |
36 | if (Access_Control::where('User_ID',$request['worker_name'])->where('room_id', $request['room_name'])->exists()) {
37 | // Record already exists, do something
38 | return back()->with('fail','This worker is already assigned with this room. Please select another one!');
39 |
40 | } else {
41 | // Record does not exist, insert data
42 | $access= new Access_Control;
43 | $access->room_id=$request['room_name'];
44 | $access->date=$request['date'];
45 | $access->User_ID=$request['worker_name'];
46 | $access->save();
47 | if($access){
48 | return back()->with('success','You have successfully assigned the room');
49 | }
50 | else
51 | {
52 | return back()->with('fail','The error occurred');
53 | }
54 | }
55 |
56 |
57 |
58 | }
59 |
60 |
61 | public function showRooms()
62 | {
63 | $user_id = session('User_ID');
64 | $rooms = RoomsModel::where('User_ID', $user_id)->with('accessControls')->get();
65 | return view('workers/dashboard', compact('rooms'));
66 | }
67 |
68 |
69 | public function accesscontroltable(){
70 |
71 | $accesstable = Access_Control::join('users', 'users.User_ID', '=', 'access_control.User_ID')
72 | ->join('rooms', 'access_control.room_id', '=', 'rooms.room_id')
73 | ->where('users.role', '=', 'Worker')
74 | ->select('access_control.access_id', 'rooms.room_name', 'users.name')
75 | ->get();
76 |
77 |
78 | return response()->json(['data' => $accesstable]);
79 | }
80 |
81 |
82 | public function deleteAccessControl($id) {
83 | $accessControl = Access_Control::find($id);
84 |
85 | if ($accessControl) {
86 | $accessControl->delete();
87 |
88 | return response()->json(['status' => 'success', 'message' => 'Access control record deleted successfully.']);
89 | } else {
90 | return response()->json(['status' => 'error', 'message' => 'Access control record not found.']);
91 | }
92 | }
93 |
94 |
95 |
96 |
97 |
98 | }
--------------------------------------------------------------------------------
/public/assets/css/vendor.bundle.base.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Container style
3 | */
4 | .ps {
5 | overflow: hidden !important;
6 | overflow-anchor: none;
7 | -ms-overflow-style: none;
8 | touch-action: auto;
9 | -ms-touch-action: auto;
10 | }
11 |
12 | /*
13 | * Scrollbar rail styles
14 | */
15 | .ps__rail-x {
16 | display: none;
17 | opacity: 0;
18 | transition: background-color .2s linear, opacity .2s linear;
19 | -webkit-transition: background-color .2s linear, opacity .2s linear;
20 | height: 15px;
21 | /* there must be 'bottom' or 'top' for ps__rail-x */
22 | bottom: 0px;
23 | /* please don't change 'position' */
24 | position: absolute;
25 | }
26 |
27 | .ps__rail-y {
28 | display: none;
29 | opacity: 0;
30 | transition: background-color .2s linear, opacity .2s linear;
31 | -webkit-transition: background-color .2s linear, opacity .2s linear;
32 | width: 15px;
33 | /* there must be 'right' or 'left' for ps__rail-y */
34 | right: 0;
35 | /* please don't change 'position' */
36 | position: absolute;
37 | }
38 |
39 | .ps--active-x > .ps__rail-x,
40 | .ps--active-y > .ps__rail-y {
41 | display: block;
42 | background-color: transparent;
43 | }
44 |
45 | .ps:hover > .ps__rail-x,
46 | .ps:hover > .ps__rail-y,
47 | .ps--focus > .ps__rail-x,
48 | .ps--focus > .ps__rail-y,
49 | .ps--scrolling-x > .ps__rail-x,
50 | .ps--scrolling-y > .ps__rail-y {
51 | opacity: 0.6;
52 | }
53 |
54 | .ps .ps__rail-x:hover,
55 | .ps .ps__rail-y:hover,
56 | .ps .ps__rail-x:focus,
57 | .ps .ps__rail-y:focus,
58 | .ps .ps__rail-x.ps--clicking,
59 | .ps .ps__rail-y.ps--clicking {
60 | background-color: #eee;
61 | opacity: 0.9;
62 | }
63 |
64 | /*
65 | * Scrollbar thumb styles
66 | */
67 | .ps__thumb-x {
68 | background-color: #aaa;
69 | border-radius: 6px;
70 | transition: background-color .2s linear, height .2s ease-in-out;
71 | -webkit-transition: background-color .2s linear, height .2s ease-in-out;
72 | height: 6px;
73 | /* there must be 'bottom' for ps__thumb-x */
74 | bottom: 2px;
75 | /* please don't change 'position' */
76 | position: absolute;
77 | }
78 |
79 | .ps__thumb-y {
80 | background-color: #aaa;
81 | border-radius: 6px;
82 | transition: background-color .2s linear, width .2s ease-in-out;
83 | -webkit-transition: background-color .2s linear, width .2s ease-in-out;
84 | width: 6px;
85 | /* there must be 'right' for ps__thumb-y */
86 | right: 2px;
87 | /* please don't change 'position' */
88 | position: absolute;
89 | }
90 |
91 | .ps__rail-x:hover > .ps__thumb-x,
92 | .ps__rail-x:focus > .ps__thumb-x,
93 | .ps__rail-x.ps--clicking .ps__thumb-x {
94 | background-color: #999;
95 | height: 11px;
96 | }
97 |
98 | .ps__rail-y:hover > .ps__thumb-y,
99 | .ps__rail-y:focus > .ps__thumb-y,
100 | .ps__rail-y.ps--clicking .ps__thumb-y {
101 | background-color: #999;
102 | width: 11px;
103 | }
104 |
105 | /* MS supports */
106 | @supports (-ms-overflow-style: none) {
107 | .ps {
108 | overflow: auto !important;
109 | }
110 | }
111 |
112 | @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
113 | .ps {
114 | overflow: auto !important;
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_CONNECTION', 'sync'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Queue Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure the connection information for each server that
24 | | is used by your application. A default configuration has been added
25 | | for each back-end shipped with Laravel. You are free to add more.
26 | |
27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'sync' => [
34 | 'driver' => 'sync',
35 | ],
36 |
37 | 'database' => [
38 | 'driver' => 'database',
39 | 'table' => 'jobs',
40 | 'queue' => 'default',
41 | 'retry_after' => 90,
42 | 'after_commit' => false,
43 | ],
44 |
45 | 'beanstalkd' => [
46 | 'driver' => 'beanstalkd',
47 | 'host' => 'localhost',
48 | 'queue' => 'default',
49 | 'retry_after' => 90,
50 | 'block_for' => 0,
51 | 'after_commit' => false,
52 | ],
53 |
54 | 'sqs' => [
55 | 'driver' => 'sqs',
56 | 'key' => env('AWS_ACCESS_KEY_ID'),
57 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
58 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
59 | 'queue' => env('SQS_QUEUE', 'default'),
60 | 'suffix' => env('SQS_SUFFIX'),
61 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
62 | 'after_commit' => false,
63 | ],
64 |
65 | 'redis' => [
66 | 'driver' => 'redis',
67 | 'connection' => 'default',
68 | 'queue' => env('REDIS_QUEUE', 'default'),
69 | 'retry_after' => 90,
70 | 'block_for' => null,
71 | 'after_commit' => false,
72 | ],
73 |
74 | ],
75 |
76 | /*
77 | |--------------------------------------------------------------------------
78 | | Failed Queue Jobs
79 | |--------------------------------------------------------------------------
80 | |
81 | | These options configure the behavior of failed queue job logging so you
82 | | can control which database and table are used to store the jobs that
83 | | have failed. You may change them to any database / table you wish.
84 | |
85 | */
86 |
87 | 'failed' => [
88 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
89 | 'database' => env('DB_CONNECTION', 'mysql'),
90 | 'table' => 'failed_jobs',
91 | ],
92 |
93 | ];
94 |
--------------------------------------------------------------------------------
/public/assets/js/settings.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 | 'use strict';
3 | $(function() {
4 | $(".nav-settings").on("click", function() {
5 | $("#right-sidebar").toggleClass("open");
6 | });
7 | $(".settings-close").on("click", function() {
8 | $("#right-sidebar,#theme-settings").removeClass("open");
9 | });
10 |
11 | $("#settings-trigger").on("click" , function(){
12 | $("#theme-settings").toggleClass("open");
13 | });
14 |
15 |
16 | //background constants
17 | var navbar_classes = "navbar-danger navbar-success navbar-warning navbar-dark navbar-light navbar-primary navbar-info navbar-pink";
18 | var sidebar_classes = "sidebar-light sidebar-dark";
19 | var $body = $("body");
20 |
21 | //sidebar backgrounds
22 | $("#sidebar-light-theme").on("click" , function(){
23 | $body.removeClass(sidebar_classes);
24 | $body.addClass("sidebar-light");
25 | $(".sidebar-bg-options").removeClass("selected");
26 | $(this).addClass("selected");
27 | });
28 | $("#sidebar-dark-theme").on("click" , function(){
29 | $body.removeClass(sidebar_classes);
30 | $body.addClass("sidebar-dark");
31 | $(".sidebar-bg-options").removeClass("selected");
32 | $(this).addClass("selected");
33 | });
34 |
35 |
36 | //Navbar Backgrounds
37 | $(".tiles.primary").on("click" , function(){
38 | $(".navbar").removeClass(navbar_classes);
39 | $(".navbar").addClass("navbar-primary");
40 | $(".tiles").removeClass("selected");
41 | $(this).addClass("selected");
42 | });
43 | $(".tiles.success").on("click" , function(){
44 | $(".navbar").removeClass(navbar_classes);
45 | $(".navbar").addClass("navbar-success");
46 | $(".tiles").removeClass("selected");
47 | $(this).addClass("selected");
48 | });
49 | $(".tiles.warning").on("click" , function(){
50 | $(".navbar").removeClass(navbar_classes);
51 | $(".navbar").addClass("navbar-warning");
52 | $(".tiles").removeClass("selected");
53 | $(this).addClass("selected");
54 | });
55 | $(".tiles.danger").on("click" , function(){
56 | $(".navbar").removeClass(navbar_classes);
57 | $(".navbar").addClass("navbar-danger");
58 | $(".tiles").removeClass("selected");
59 | $(this).addClass("selected");
60 | });
61 | $(".tiles.light").on("click" , function(){
62 | $(".navbar").removeClass(navbar_classes);
63 | $(".navbar").addClass("navbar-light");
64 | $(".tiles").removeClass("selected");
65 | $(this).addClass("selected");
66 | });
67 | $(".tiles.info").on("click" , function(){
68 | $(".navbar").removeClass(navbar_classes);
69 | $(".navbar").addClass("navbar-info");
70 | $(".tiles").removeClass("selected");
71 | $(this).addClass("selected");
72 | });
73 | $(".tiles.dark").on("click" , function(){
74 | $(".navbar").removeClass(navbar_classes);
75 | $(".navbar").addClass("navbar-dark");
76 | $(".tiles").removeClass("selected");
77 | $(this).addClass("selected");
78 | });
79 | $(".tiles.default").on("click" , function(){
80 | $(".navbar").removeClass(navbar_classes);
81 | $(".tiles").removeClass("selected");
82 | $(this).addClass("selected");
83 | });
84 | });
85 | })(jQuery);
86 |
--------------------------------------------------------------------------------
/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Cache Stores
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the cache "stores" for your application as
26 | | well as their drivers. You may even define multiple stores for the
27 | | same cache driver to group types of items stored in your caches.
28 | |
29 | | Supported drivers: "apc", "array", "database", "file",
30 | | "memcached", "redis", "dynamodb", "octane", "null"
31 | |
32 | */
33 |
34 | 'stores' => [
35 |
36 | 'apc' => [
37 | 'driver' => 'apc',
38 | ],
39 |
40 | 'array' => [
41 | 'driver' => 'array',
42 | 'serialize' => false,
43 | ],
44 |
45 | 'database' => [
46 | 'driver' => 'database',
47 | 'table' => 'cache',
48 | 'connection' => null,
49 | 'lock_connection' => null,
50 | ],
51 |
52 | 'file' => [
53 | 'driver' => 'file',
54 | 'path' => storage_path('framework/cache/data'),
55 | ],
56 |
57 | 'memcached' => [
58 | 'driver' => 'memcached',
59 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
60 | 'sasl' => [
61 | env('MEMCACHED_USERNAME'),
62 | env('MEMCACHED_PASSWORD'),
63 | ],
64 | 'options' => [
65 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
66 | ],
67 | 'servers' => [
68 | [
69 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
70 | 'port' => env('MEMCACHED_PORT', 11211),
71 | 'weight' => 100,
72 | ],
73 | ],
74 | ],
75 |
76 | 'redis' => [
77 | 'driver' => 'redis',
78 | 'connection' => 'cache',
79 | 'lock_connection' => 'default',
80 | ],
81 |
82 | 'dynamodb' => [
83 | 'driver' => 'dynamodb',
84 | 'key' => env('AWS_ACCESS_KEY_ID'),
85 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
86 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
87 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
88 | 'endpoint' => env('DYNAMODB_ENDPOINT'),
89 | ],
90 |
91 | 'octane' => [
92 | 'driver' => 'octane',
93 | ],
94 |
95 | ],
96 |
97 | /*
98 | |--------------------------------------------------------------------------
99 | | Cache Key Prefix
100 | |--------------------------------------------------------------------------
101 | |
102 | | When utilizing the APC, database, memcached, Redis, or DynamoDB cache
103 | | stores there might be other applications using the same cache. For
104 | | that reason, you may prefix every cache key to avoid collisions.
105 | |
106 | */
107 |
108 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
109 |
110 | ];
111 |
--------------------------------------------------------------------------------
/app/Http/Controllers/workertransactioncontroller.php:
--------------------------------------------------------------------------------
1 | get();
24 | $customers = Customers::select('customer_id', 'customer_name')->get();
25 | $games = Products::select('product_id', 'product_name')->get();
26 | $payments = Payments::select('payment_id', 'payment_name')->get();
27 |
28 | $user_id = session('User_ID');
29 | $access_controls = DB::table('access_control')
30 | ->join('rooms', 'access_control.room_id', '=', 'rooms.room_id')
31 | ->where('access_control.User_ID', $user_id)
32 | ->select('access_control.User_ID', 'access_control.status', 'rooms.room_name','access_control.room_id')
33 | ->get();
34 |
35 |
36 | $user_id = session('User_ID');
37 |
38 | $access_controls2 = DB::table('rooms')
39 | ->join('access_control', 'rooms.room_id', '=', 'access_control.room_id')
40 | ->select('rooms.room_name','rooms.room_id')
41 | ->where('access_control.User_ID', '=', 2)
42 | ->where('access_control.status', '=', DB::raw('rooms.room_id'))
43 | ->get();
44 |
45 | $countrooms = Access_Control::where('User_ID', $user_id)->count();
46 |
47 |
48 | return view('workers/create_transactions',compact('rooms','customers','games',
49 | 'payments','access_controls','countrooms','access_controls2'));
50 | }
51 |
52 |
53 | public function getTransactions()
54 | {
55 | $transactions = Transactions::join('customers', 'transactions.customer_id', '=', 'customers.customer_id')
56 | ->join('products', 'transactions.product_id', '=', 'products.product_id')
57 | ->join('users', 'transactions.User_ID', '=', 'users.User_ID')
58 | ->join('payments', 'transactions.payment_id', '=', 'payments.payment_id')
59 | ->select('transactions.transaction_id', 'transactions.type', 'transactions.note',
60 | 'transactions.cash', 'transactions.Credit','transactions.date',
61 | 'customers.customer_name as name', 'products.product_name as product_name',
62 | 'users.name as user_name', 'payments.payment_name as payment_name')
63 | ->get();
64 |
65 |
66 | return response()->json(['data' => $transactions]);
67 |
68 | }
69 |
70 | public function viewtransactions(){
71 |
72 | $user_id = session('User_ID');
73 |
74 | $access_controls = DB::table('access_control')
75 | ->join('rooms', 'access_control.room_id', '=', 'rooms.room_id')
76 | ->where('access_control.User_ID', $user_id)
77 | ->select('access_control.User_ID', 'access_control.status', 'rooms.room_name','access_control.room_id')
78 | ->get();
79 |
80 | $access_controls2 = DB::table('rooms')
81 | ->join('access_control', 'rooms.room_id', '=', 'access_control.room_id')
82 | ->select('rooms.room_name','rooms.room_id')
83 | ->where('access_control.User_ID', '=', 2)
84 | ->where('access_control.status', '=', DB::raw('rooms.room_id'))
85 | ->get();
86 |
87 |
88 | $countrooms = Access_Control::where('User_ID', $user_id)->count();
89 |
90 | return view('workers/view_transaction',compact('access_controls2','countrooms','access_controls'));
91 | }
92 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/clockcontroller.php:
--------------------------------------------------------------------------------
1 | validate(
16 | [
17 | "room_id"=>"required"
18 | ]
19 | );
20 |
21 |
22 | if (ClockModel::where('User_ID',$request['User_ID'])->where('status', "CheckIn")->exists()) {
23 | // Record already exists, do something
24 | return back()->with('fail','You have already done the Clock In');
25 |
26 | } else {
27 |
28 | $clockin= new ClockModel;
29 | $clockin->checkin=$request['checkin'];
30 | $clockin->date=$request['date'];
31 | $clockin->status="CheckIn";
32 | $clockin->currentstatus="CheckIn";
33 | $clockin->room_id=$request['room_id'];
34 | $clockin->User_ID=$request['User_ID'];
35 | $clockin->save();
36 | if($clockin){
37 | return back()->with('success','You have successfully Clock In!');
38 | }
39 | else
40 | {
41 | return back()->with('fail','The error occurred');
42 | }
43 |
44 | }
45 |
46 |
47 |
48 | }
49 |
50 |
51 |
52 | public function checkindata(Request $request){
53 |
54 |
55 | if (ClockModel::where('User_ID',$request['User_ID'])->where('currentstatus', "CheckIn")->exists()) {
56 | // Record already exists, do something
57 | return back()->with('fail','You have already done the Clock In');
58 |
59 | } else {
60 |
61 |
62 | $clockin= new ClockModel;
63 | $clockin->checkin=$request['checkin'];
64 | $clockin->date=$request['date'];
65 | $clockin->status="CheckIn";
66 | $clockin->room_id=$request['room_id'];
67 | $clockin->User_ID=$request['User_ID'];
68 |
69 | $user_id = session('User_ID');
70 | ClockModel::where('User_ID', $user_id)->update(['currentstatus' => "CheckIn"]);
71 | $clockin->save();
72 | if($clockin){
73 | return back()->with('success','You have successfully Clock In!');
74 | }
75 | else
76 | {
77 | return back()->with('fail','The error occurred');
78 | }
79 |
80 | }
81 |
82 |
83 |
84 | }
85 |
86 | public function checkoutdata(Request $request){
87 |
88 |
89 | if (ClockModel::where('User_ID',$request['User_ID'])->where('currentstatus', "CheckOut")->exists()) {
90 | // Record already exists, do something
91 | return back()->with('fail','You have already done the Clock Out');
92 |
93 | } else {
94 |
95 |
96 | $clockin= new ClockModel;
97 | $clockin->checkout=$request['checkout'];
98 | $clockin->date=$request['date'];
99 | $clockin->status="CheckOut";
100 | $user_id = session('User_ID');
101 | ClockModel::where('User_ID', $user_id)->update(['currentstatus' => "CheckOut"]);
102 | $clockin->room_id=$request['room_id'];
103 | $clockin->User_ID=$request['User_ID'];
104 | $clockin->save();
105 | if($clockin){
106 | return back()->with('success','You have successfully Clock Out!');
107 | }
108 | else
109 | {
110 | return back()->with('fail','The error occurred');
111 | }
112 |
113 | }
114 |
115 |
116 |
117 | }
118 |
119 | public function checkcheckin(){
120 |
121 | $count = ClockModel::where('User_ID', $request['User_ID'])->where('status', 'CheckIn')->orderBy('created_at', 'desc')->count();
122 |
123 |
124 |
125 |
126 | }
127 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | ## About Laravel
11 |
12 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
13 |
14 | - [Simple, fast routing engine](https://laravel.com/docs/routing).
15 | - [Powerful dependency injection container](https://laravel.com/docs/container).
16 | - Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
17 | - Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
18 | - Database agnostic [schema migrations](https://laravel.com/docs/migrations).
19 | - [Robust background job processing](https://laravel.com/docs/queues).
20 | - [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
21 |
22 | Laravel is accessible, powerful, and provides tools required for large, robust applications.
23 |
24 | ## Learning Laravel
25 |
26 | Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
27 |
28 | You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
29 |
30 | If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
31 |
32 | ## Laravel Sponsors
33 |
34 | We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
35 |
36 | ### Premium Partners
37 |
38 | - **[Vehikl](https://vehikl.com/)**
39 | - **[Tighten Co.](https://tighten.co)**
40 | - **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
41 | - **[64 Robots](https://64robots.com)**
42 | - **[Cubet Techno Labs](https://cubettech.com)**
43 | - **[Cyber-Duck](https://cyber-duck.co.uk)**
44 | - **[Many](https://www.many.co.uk)**
45 | - **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
46 | - **[DevSquad](https://devsquad.com)**
47 | - **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
48 | - **[OP.GG](https://op.gg)**
49 | - **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
50 | - **[Lendio](https://lendio.com)**
51 |
52 | ## Contributing
53 |
54 | Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
55 |
56 | ## Code of Conduct
57 |
58 | In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
59 |
60 | ## Security Vulnerabilities
61 |
62 | If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
63 |
64 | ## License
65 |
66 | The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
67 | # sellermanagement
68 |
--------------------------------------------------------------------------------
/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_MAILER', 'smtp'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Mailer Configurations
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure all of the mailers used by your application plus
24 | | their respective settings. Several examples have been configured for
25 | | you and you are free to add your own as your application requires.
26 | |
27 | | Laravel supports a variety of mail "transport" drivers to be used while
28 | | sending an e-mail. You will specify which one you are using for your
29 | | mailers below. You are free to add additional mailers as required.
30 | |
31 | | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
32 | | "postmark", "log", "array", "failover"
33 | |
34 | */
35 |
36 | 'mailers' => [
37 | 'smtp' => [
38 | 'transport' => 'smtp',
39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
40 | 'port' => env('MAIL_PORT', 587),
41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
42 | 'username' => env('MAIL_USERNAME'),
43 | 'password' => env('MAIL_PASSWORD'),
44 | 'timeout' => null,
45 | 'local_domain' => env('MAIL_EHLO_DOMAIN'),
46 | ],
47 |
48 | 'ses' => [
49 | 'transport' => 'ses',
50 | ],
51 |
52 | 'mailgun' => [
53 | 'transport' => 'mailgun',
54 | // 'client' => [
55 | // 'timeout' => 5,
56 | // ],
57 | ],
58 |
59 | 'postmark' => [
60 | 'transport' => 'postmark',
61 | // 'client' => [
62 | // 'timeout' => 5,
63 | // ],
64 | ],
65 |
66 | 'sendmail' => [
67 | 'transport' => 'sendmail',
68 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
69 | ],
70 |
71 | 'log' => [
72 | 'transport' => 'log',
73 | 'channel' => env('MAIL_LOG_CHANNEL'),
74 | ],
75 |
76 | 'array' => [
77 | 'transport' => 'array',
78 | ],
79 |
80 | 'failover' => [
81 | 'transport' => 'failover',
82 | 'mailers' => [
83 | 'smtp',
84 | 'log',
85 | ],
86 | ],
87 | ],
88 |
89 | /*
90 | |--------------------------------------------------------------------------
91 | | Global "From" Address
92 | |--------------------------------------------------------------------------
93 | |
94 | | You may wish for all e-mails sent by your application to be sent from
95 | | the same address. Here, you may specify a name and address that is
96 | | used globally for all e-mails that are sent by your application.
97 | |
98 | */
99 |
100 | 'from' => [
101 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
102 | 'name' => env('MAIL_FROM_NAME', 'Example'),
103 | ],
104 |
105 | /*
106 | |--------------------------------------------------------------------------
107 | | Markdown Mail Settings
108 | |--------------------------------------------------------------------------
109 | |
110 | | If you are using Markdown based email rendering, you may configure your
111 | | theme and component paths here, allowing you to customize the design
112 | | of the emails. Or, you may simply stick with the Laravel defaults!
113 | |
114 | */
115 |
116 | 'markdown' => [
117 | 'theme' => 'default',
118 |
119 | 'paths' => [
120 | resource_path('views/vendor/mail'),
121 | ],
122 | ],
123 |
124 | ];
125 |
--------------------------------------------------------------------------------
/config/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
21 |
22 | /*
23 | |--------------------------------------------------------------------------
24 | | Deprecations Log Channel
25 | |--------------------------------------------------------------------------
26 | |
27 | | This option controls the log channel that should be used to log warnings
28 | | regarding deprecated PHP and library features. This allows you to get
29 | | your application ready for upcoming major versions of dependencies.
30 | |
31 | */
32 |
33 | 'deprecations' => [
34 | 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
35 | 'trace' => false,
36 | ],
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Log Channels
41 | |--------------------------------------------------------------------------
42 | |
43 | | Here you may configure the log channels for your application. Out of
44 | | the box, Laravel uses the Monolog PHP logging library. This gives
45 | | you a variety of powerful log handlers / formatters to utilize.
46 | |
47 | | Available Drivers: "single", "daily", "slack", "syslog",
48 | | "errorlog", "monolog",
49 | | "custom", "stack"
50 | |
51 | */
52 |
53 | 'channels' => [
54 | 'stack' => [
55 | 'driver' => 'stack',
56 | 'channels' => ['single'],
57 | 'ignore_exceptions' => false,
58 | ],
59 |
60 | 'single' => [
61 | 'driver' => 'single',
62 | 'path' => storage_path('logs/laravel.log'),
63 | 'level' => env('LOG_LEVEL', 'debug'),
64 | ],
65 |
66 | 'daily' => [
67 | 'driver' => 'daily',
68 | 'path' => storage_path('logs/laravel.log'),
69 | 'level' => env('LOG_LEVEL', 'debug'),
70 | 'days' => 14,
71 | ],
72 |
73 | 'slack' => [
74 | 'driver' => 'slack',
75 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
76 | 'username' => 'Laravel Log',
77 | 'emoji' => ':boom:',
78 | 'level' => env('LOG_LEVEL', 'critical'),
79 | ],
80 |
81 | 'papertrail' => [
82 | 'driver' => 'monolog',
83 | 'level' => env('LOG_LEVEL', 'debug'),
84 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
85 | 'handler_with' => [
86 | 'host' => env('PAPERTRAIL_URL'),
87 | 'port' => env('PAPERTRAIL_PORT'),
88 | 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
89 | ],
90 | ],
91 |
92 | 'stderr' => [
93 | 'driver' => 'monolog',
94 | 'level' => env('LOG_LEVEL', 'debug'),
95 | 'handler' => StreamHandler::class,
96 | 'formatter' => env('LOG_STDERR_FORMATTER'),
97 | 'with' => [
98 | 'stream' => 'php://stderr',
99 | ],
100 | ],
101 |
102 | 'syslog' => [
103 | 'driver' => 'syslog',
104 | 'level' => env('LOG_LEVEL', 'debug'),
105 | 'facility' => LOG_USER,
106 | ],
107 |
108 | 'errorlog' => [
109 | 'driver' => 'errorlog',
110 | 'level' => env('LOG_LEVEL', 'debug'),
111 | ],
112 |
113 | 'null' => [
114 | 'driver' => 'monolog',
115 | 'handler' => NullHandler::class,
116 | ],
117 |
118 | 'emergency' => [
119 | 'path' => storage_path('logs/laravel.log'),
120 | ],
121 | ],
122 |
123 | ];
124 |
--------------------------------------------------------------------------------
/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 | ],
44 |
45 | /*
46 | |--------------------------------------------------------------------------
47 | | User Providers
48 | |--------------------------------------------------------------------------
49 | |
50 | | All authentication drivers have a user provider. This defines how the
51 | | users are actually retrieved out of your database or other storage
52 | | mechanisms used by this application to persist your user's data.
53 | |
54 | | If you have multiple user tables or models you may configure multiple
55 | | sources which represent each model / table. These sources may then
56 | | be assigned to any extra authentication guards you have defined.
57 | |
58 | | Supported: "database", "eloquent"
59 | |
60 | */
61 |
62 | 'providers' => [
63 | 'users' => [
64 | 'driver' => 'eloquent',
65 | 'model' => App\Models\User::class,
66 | ],
67 |
68 | // 'users' => [
69 | // 'driver' => 'database',
70 | // 'table' => 'users',
71 | // ],
72 | ],
73 |
74 | /*
75 | |--------------------------------------------------------------------------
76 | | Resetting Passwords
77 | |--------------------------------------------------------------------------
78 | |
79 | | You may specify multiple password reset configurations if you have more
80 | | than one user table or model in the application and you want to have
81 | | separate password reset settings based on the specific user types.
82 | |
83 | | The expiry time is the number of minutes that each reset token will be
84 | | considered valid. This security feature keeps tokens short-lived so
85 | | they have less time to be guessed. You may change this as needed.
86 | |
87 | | The throttle setting is the number of seconds a user must wait before
88 | | generating more password reset tokens. This prevents the user from
89 | | quickly generating a very large amount of password reset tokens.
90 | |
91 | */
92 |
93 | 'passwords' => [
94 | 'users' => [
95 | 'provider' => 'users',
96 | 'table' => 'password_reset_tokens',
97 | 'expire' => 60,
98 | 'throttle' => 60,
99 | ],
100 | ],
101 |
102 | /*
103 | |--------------------------------------------------------------------------
104 | | Password Confirmation Timeout
105 | |--------------------------------------------------------------------------
106 | |
107 | | Here you may define the amount of seconds before a password confirmation
108 | | times out and the user is prompted to re-enter their password via the
109 | | confirmation screen. By default, the timeout lasts for three hours.
110 | |
111 | */
112 |
113 | 'password_timeout' => 10800,
114 |
115 | ];
116 |
--------------------------------------------------------------------------------
/public/assets/js/template.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 | 'use strict';
3 | $(function() {
4 | var body = $('body');
5 | var contentWrapper = $('.content-wrapper');
6 | var scroller = $('.container-scroller');
7 | var footer = $('.footer');
8 | var sidebar = $('.sidebar');
9 |
10 | //Add active class to nav-link based on url dynamically
11 | //Active class can be hard coded directly in html file also as required
12 |
13 | function addActiveClass(element) {
14 | if (current === "") {
15 | //for root url
16 | if (element.attr('href').indexOf("index.html") !== -1) {
17 | element.parents('.nav-item').last().addClass('active');
18 | if (element.parents('.sub-menu').length) {
19 | element.closest('.collapse').addClass('show');
20 | element.addClass('active');
21 | }
22 | }
23 | } else {
24 | //for other url
25 | if (element.attr('href').indexOf(current) !== -1) {
26 | element.parents('.nav-item').last().addClass('active');
27 | if (element.parents('.sub-menu').length) {
28 | element.closest('.collapse').addClass('show');
29 | element.addClass('active');
30 | }
31 | if (element.parents('.submenu-item').length) {
32 | element.addClass('active');
33 | }
34 | }
35 | }
36 | }
37 |
38 | var current = location.pathname.split("/").slice(-1)[0].replace(/^\/|\/$/g, '');
39 | $('.nav li a', sidebar).each(function() {
40 | var $this = $(this);
41 | addActiveClass($this);
42 | })
43 |
44 | $('.horizontal-menu .nav li a').each(function() {
45 | var $this = $(this);
46 | addActiveClass($this);
47 | })
48 |
49 | //Close other submenu in sidebar on opening any
50 |
51 | sidebar.on('show.bs.collapse', '.collapse', function() {
52 | sidebar.find('.collapse.show').collapse('hide');
53 | });
54 |
55 |
56 | //Change sidebar and content-wrapper height
57 | applyStyles();
58 |
59 | function applyStyles() {
60 | //Applying perfect scrollbar
61 | if (!body.hasClass("rtl")) {
62 | if ($('.settings-panel .tab-content .tab-pane.scroll-wrapper').length) {
63 | const settingsPanelScroll = new PerfectScrollbar('.settings-panel .tab-content .tab-pane.scroll-wrapper');
64 | }
65 | if ($('.chats').length) {
66 | const chatsScroll = new PerfectScrollbar('.chats');
67 | }
68 | if (body.hasClass("sidebar-fixed")) {
69 | if($('#sidebar').length) {
70 | var fixedSidebarScroll = new PerfectScrollbar('#sidebar .nav');
71 | }
72 | }
73 | }
74 | }
75 |
76 | $('[data-toggle="minimize"]').on("click", function() {
77 | if ((body.hasClass('sidebar-toggle-display')) || (body.hasClass('sidebar-absolute'))) {
78 | body.toggleClass('sidebar-hidden');
79 | } else {
80 | body.toggleClass('sidebar-icon-only');
81 | }
82 | });
83 |
84 | //checkbox and radios
85 | $(".form-check label,.form-radio label").append('');
86 |
87 | //Horizontal menu in mobile
88 | $('[data-toggle="horizontal-menu-toggle"]').on("click", function() {
89 | $(".horizontal-menu .bottom-navbar").toggleClass("header-toggled");
90 | });
91 | // Horizontal menu navigation in mobile menu on click
92 | var navItemClicked = $('.horizontal-menu .page-navigation >.nav-item');
93 | navItemClicked.on("click", function(event) {
94 | if(window.matchMedia('(max-width: 991px)').matches) {
95 | if(!($(this).hasClass('show-submenu'))) {
96 | navItemClicked.removeClass('show-submenu');
97 | }
98 | $(this).toggleClass('show-submenu');
99 | }
100 | })
101 |
102 | $(window).scroll(function() {
103 | if(window.matchMedia('(min-width: 992px)').matches) {
104 | var header = $('.horizontal-menu');
105 | if ($(window).scrollTop() >= 70) {
106 | $(header).addClass('fixed-on-scroll');
107 | } else {
108 | $(header).removeClass('fixed-on-scroll');
109 | }
110 | }
111 | });
112 | });
113 |
114 | // focus input when clicking on search icon
115 | $('#navbar-search-icon').click(function() {
116 | $("#navbar-search-input").focus();
117 | });
118 |
119 | })(jQuery);
--------------------------------------------------------------------------------
/resources/views/admin/chat.blade.php:
--------------------------------------------------------------------------------
1 | @include('layouts.adminnav')
2 | @push('title')
3 | Fire Wins | Create Payments
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
Firewinz Chat
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | @foreach($viewchat as $data)
30 |
31 | @php
32 | $i = Session::get('User_ID');
33 |
34 | @endphp
35 | @if($data->User_ID ==$i)
36 |
37 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | @else
51 |
52 |
53 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | @endif
67 |
68 | @endforeach
69 |
70 |
71 |
72 |
73 |
74 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |