Skip to content

Find housemate #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 280 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
280 commits
Select commit Hold shift + click to select a range
654bf38
tukar jadi component supaya tak serabut codenya
naaasruul Apr 21, 2025
2c78afb
buat theme pink
naaasruul Apr 21, 2025
0ed4266
dashboard admin masih kosong
naaasruul Apr 21, 2025
59215f0
page untuk admin manage seller
naaasruul Apr 21, 2025
40e0bba
account profile untuk customer
naaasruul Apr 21, 2025
6598e08
tukar kepada dynamic page
naaasruul Apr 21, 2025
c36cba5
tukar class
naaasruul Apr 21, 2025
1857147
refactor this section
naaasruul Apr 21, 2025
e0585ad
sadas
naaasruul Apr 21, 2025
9fb3438
this layout filtered by roles
naaasruul Apr 21, 2025
2d656f7
enhance code
naaasruul Apr 21, 2025
1b336cf
commentn je
naaasruul Apr 21, 2025
0ec6412
buang logo laravel kt login
naaasruul Apr 21, 2025
434daa8
sdasd
naaasruul Apr 21, 2025
07d7496
tambah simple database punya CDN
naaasruul Apr 21, 2025
511fdd3
enhance
naaasruul Apr 21, 2025
da27983
buat routing
naaasruul Apr 21, 2025
9decb81
tambah rating dan harga product
naaasruul Apr 21, 2025
b3e2f81
pakai icon nadiswap
naaasruul Apr 21, 2025
7fd503f
tambah delivery addreses
naaasruul Apr 21, 2025
3438ce7
tambah DeliveryAddress model dan controller untuk menyimpan alamat pe…
naaasruul Apr 21, 2025
66f4388
tambah relations
naaasruul Apr 21, 2025
b7dcd47
tambah component App Icon
naaasruul Apr 21, 2025
0af7e34
tambah component Order Card
naaasruul Apr 21, 2025
bef1064
refactor code lagi helok
naaasruul Apr 21, 2025
c2d1d93
icon nadiswap
naaasruul Apr 21, 2025
bc1163f
table delivery address
naaasruul Apr 21, 2025
f449489
tukar app icon
naaasruul Apr 21, 2025
9183a79
routing untuk delivery addreess
naaasruul Apr 21, 2025
08f49d0
fix spacing
naaasruul Apr 22, 2025
34a4133
add profile controller
naaasruul Apr 22, 2025
ea6134e
tambah table phone_number
naaasruul Apr 22, 2025
b6dd3c4
refactor modal and make a dynamic phone number
naaasruul Apr 22, 2025
597c7eb
tukar color
naaasruul Apr 22, 2025
24ada18
tukar color
naaasruul Apr 22, 2025
d80b3c8
seeder enhancemnets
naaasruul Apr 22, 2025
429f906
update email addresses in UserSeeder for admin and seller users
naaasruul Apr 22, 2025
29fdb7c
admin manage-buyer
naaasruul Apr 22, 2025
ecb746c
fixed
naaasruul Apr 22, 2025
db326f3
update register user
naaasruul Apr 25, 2025
df8397f
update user seeder
naaasruul Apr 25, 2025
e826c50
test
naaasruul Apr 25, 2025
a7f90ce
add clockwork
claymor333 Apr 25, 2025
1ca8fbd
Merge branch 'main' of https://github.com/naaasruul/nadiSwap
claymor333 Apr 25, 2025
d639991
updated sidebar item
naaasruul Apr 25, 2025
c4ce95b
add CategoryController, Category model, migration, and categories view
naaasruul Apr 25, 2025
c15147c
add Categories route and sidebar item for sellers
naaasruul Apr 25, 2025
c14d486
Merge branch 'main' of https://github.com/naaasruul/flowbite-app
naaasruul Apr 25, 2025
af6a14f
category preference algo
claymor333 Apr 25, 2025
c72c84a
reccomendation algorithm
claymor333 Apr 25, 2025
82aaff2
recommendation algorithm
claymor333 Apr 25, 2025
4c3e473
product seeder
claymor333 Apr 25, 2025
c840b03
buyer user seeder
claymor333 Apr 25, 2025
46fd0bc
create categories and display pn category page
naaasruul Apr 27, 2025
2a6e81c
time add review, nanti categorynya bboleh diselect by apa yang dia add
naaasruul Apr 27, 2025
48d737e
add edit delete for category
naaasruul Apr 27, 2025
1a974bd
Enhance product management interface with export functionality and im…
naaasruul Apr 28, 2025
8dd77b1
Refactor product update validation and enhance product listing layout…
naaasruul Apr 28, 2025
728b4f1
function to add shipping review completed
naaasruul Apr 28, 2025
9dd2f60
CRUD for Shipping fee
naaasruul Apr 28, 2025
a7c9573
Merge branch 'main' of https://github.com/naaasruul/nadiSwap into random
claymor333 Apr 29, 2025
e57e86e
Implement Order management features with CRUD operations and enhance …
naaasruul Apr 29, 2025
ea83d6d
Refactor product listing to show only seller's products and implement…
naaasruul Apr 29, 2025
d636c91
Add orders resource route for seller management
naaasruul Apr 29, 2025
65503e6
GIANT REFACTOR OF PREFERENCE ALGORITHM
claymor333 Apr 29, 2025
4386798
add relationships
claymor333 Apr 29, 2025
10fd7b4
add relationships
claymor333 Apr 29, 2025
5b6377f
modify factory to use category_id
claymor333 Apr 29, 2025
8e446a3
debugging
claymor333 Apr 29, 2025
7b739bb
modify web
claymor333 Apr 29, 2025
9fba43c
search histories table
claymor333 Apr 29, 2025
36f2d10
use migration created by artisan instead of relying on created ones s…
claymor333 Apr 29, 2025
ef13004
add category_id and drop category
claymor333 Apr 29, 2025
fbe8b86
use category_id instead of category in ucp
claymor333 Apr 29, 2025
ae367f1
category seeder
claymor333 Apr 29, 2025
4426cd5
old buyer dashboard
claymor333 Apr 29, 2025
4b098c8
new buyer dashboard
claymor333 Apr 29, 2025
25d0167
Implement payment and delivery status update functionality for orders
naaasruul Apr 29, 2025
2881d86
order completed
naaasruul Apr 29, 2025
e7483db
re add show account and reset button also resets search history
claymor333 Apr 29, 2025
2d4977b
Implement review management features for sellers, including viewing, …
naaasruul Apr 29, 2025
361f424
Add 'response' field to fillable attributes in Review model
naaasruul Apr 29, 2025
e4c0cc9
Add 'response' field to reviews table migration
naaasruul Apr 29, 2025
749cab9
Update sidebar route for reviews to use correct path
naaasruul Apr 29, 2025
946f07b
Add reviews management view with response functionality for sellers
naaasruul Apr 29, 2025
b1c14f4
Add reviews resource routes and response functionality for sellers
naaasruul Apr 29, 2025
1c30cdf
too much changes i forgot
claymor333 Apr 29, 2025
308cb87
show all even after recommended
claymor333 Apr 29, 2025
0e30d3a
adjust cart controller
claymor333 Apr 29, 2025
9253731
paginator
claymor333 Apr 29, 2025
29b8493
adjust category badge on product card
claymor333 Apr 29, 2025
396c584
adjust cart logic
claymor333 Apr 29, 2025
42f0e93
move into respective role group
claymor333 Apr 29, 2025
a3f6dd0
profile avatar uploading (BASIC)
claymor333 Apr 29, 2025
c37144e
Add report generation functionality for sellers with sales data visua…
naaasruul Apr 30, 2025
5970fb2
tidy
claymor333 Apr 30, 2025
97cca82
Merge branch 'main' of https://github.com/naaasruul/nadiSwap into buy…
claymor333 Apr 30, 2025
0e70f89
Remove unused div for pie chart in sales report view
naaasruul Apr 30, 2025
937f46c
Merge branch 'main' of https://github.com/naaasruul/flowbite-app
naaasruul Apr 30, 2025
8363fc1
Merge branch 'main' of https://github.com/naaasruul/nadiSwap into random
claymor333 Apr 30, 2025
68dde8d
delete selection
naaasruul Apr 30, 2025
ef2c9ad
add better UI
naaasruul Apr 30, 2025
40ebe13
Merge branch 'random'
claymor333 Apr 30, 2025
26890c6
hotfix
claymor333 Apr 30, 2025
dca1012
add errors and improve UX
claymor333 Apr 30, 2025
15e1f31
use readonly instead of disabled due to form requirements
claymor333 Apr 30, 2025
33150ba
Implement multi-image upload for products and update related views an…
naaasruul Apr 30, 2025
e9bb7a0
Merge branch 'main' of https://github.com/naaasruul/flowbite-app
naaasruul Apr 30, 2025
7446b78
layout
claymor333 Apr 30, 2025
dbfc6c3
Merge branch 'main' of https://github.com/naaasruul/nadiSwap
claymor333 Apr 30, 2025
beb3447
now in json formatting
claymor333 Apr 30, 2025
486ee12
decode json, use first image in array as thumbnail
claymor333 Apr 30, 2025
fd22dfa
use asset
claymor333 Apr 30, 2025
06f93b5
image carousel
claymor333 Apr 30, 2025
acea14d
Refactor product category handling: update validation, model, and vie…
naaasruul Apr 30, 2025
e10b70d
cart use json object 0 for images
claymor333 Apr 30, 2025
50bbf1a
Add ListOrder, Rating, and Transaction controllers with basic CRUD me…
naaasruul Apr 30, 2025
8f469df
Refactor UI components: update color scheme to use pink accents acros…
naaasruul Apr 30, 2025
18abbc7
add seller id
claymor333 Apr 30, 2025
2749227
logging, add functionalities to cart index and hotfix index view retu…
claymor333 Apr 30, 2025
cb2ad5f
modification migration for shippings table
claymor333 Apr 30, 2025
97ec06c
Merge branch 'hotfix2'
claymor333 Apr 30, 2025
bb03263
Refactor admin controllers and views to enhance order, rating, and tr…
naaasruul May 1, 2025
effbe4d
Remove order status assignment and update button styles in cart view
naaasruul May 1, 2025
4282201
Enhance checkout process: update cart quantities from JSON input, cal…
claymor333 May 2, 2025
1a8d023
add success
claymor333 May 2, 2025
55c6749
Enhance cart functionality: add delivery address selection, update sh…
claymor333 May 2, 2025
996838d
comment category filter
claymor333 May 2, 2025
8912cb1
add buttons to headers
claymor333 May 2, 2025
bb5a1c3
contact page
claymor333 May 2, 2025
bbfc357
add product category filter on header
claymor333 May 2, 2025
8ea5f74
add contact page
claymor333 May 2, 2025
667e31f
invoice page
claymor333 May 2, 2025
af319d2
update order listy
claymor333 May 2, 2025
be87928
update order list
claymor333 May 2, 2025
65f3250
renaem
claymor333 May 2, 2025
7b22a8c
add invoice route
claymor333 May 2, 2025
6ed24d0
mailtrap mailing from contact us form
claymor333 May 2, 2025
23de7ae
encode cart items after checkout
naaasruul May 3, 2025
95953ce
decode data cart items dulu
naaasruul May 3, 2025
aac74e8
add seller id when create shipping
naaasruul May 3, 2025
7f453e9
decode cart items
naaasruul May 3, 2025
566c080
tukar color kepada pink
naaasruul May 3, 2025
ecd1e3d
buang border sebab buruk
naaasruul May 3, 2025
ebd4265
pun tukar color ke pink
naaasruul May 3, 2025
e2d702c
tukar warna border dan fokus kepada pink dalam borang hubungan
naaasruul May 3, 2025
6b8283d
buang karakter tidak perlu dalam laporan penjualan
naaasruul May 3, 2025
fe7f3ab
add env example
naaasruul May 5, 2025
8d80340
product can be add with decimal number
naaasruul May 5, 2025
aee204d
RESET PASSWORD SIAP !
naaasruul May 5, 2025
5f71cb1
configure data with log it says ok je
naaasruul May 5, 2025
81b67d4
installing stripe
naaasruul May 5, 2025
a99b40c
set email, phone number, unique and password validation dhould be bet…
naaasruul May 6, 2025
9440671
display any errors
naaasruul May 6, 2025
9e6e760
header user selain buyer takde item yg berkaitan
naaasruul May 6, 2025
296f1dd
not allowed user when id mode seller / admin
naaasruul May 6, 2025
66a6e87
refactor checkout process to handle file receipt upload and improve e…
naaasruul May 6, 2025
1b355f3
add file_receipt to Order model fillable attributes
naaasruul May 6, 2025
ece11dc
add file_receipt column to orders table migration
naaasruul May 6, 2025
d4b8efe
add file receipt upload functionality to checkout form
naaasruul May 6, 2025
5c8177e
add receipt column and display functionality to orders table
naaasruul May 6, 2025
a0b4160
fix: remove redundant border class from reviews table
naaasruul May 6, 2025
8226aa0
kasi nampak button add review ni, kita bg bg color
naaasruul May 6, 2025
cb79215
display invoice details
naaasruul May 6, 2025
719b16b
display shipping fee
naaasruul May 6, 2025
e047ca5
no qr
naaasruul May 6, 2025
1ab55f9
logic error
naaasruul May 6, 2025
469a269
lol
naaasruul May 6, 2025
24d0303
asds
naaasruul May 6, 2025
2b995e5
show products with stock >0
claymor333 May 7, 2025
ceebdf6
better carousel buttons
claymor333 May 7, 2025
308ec42
fix small main image focus
claymor333 May 7, 2025
6e7e138
quantity limit warning by checking the stock when attempting to add t…
claymor333 May 7, 2025
fb850b6
cart submit instead of button
claymor333 May 7, 2025
b3fbf96
restrict cart quantity selection
claymor333 May 7, 2025
1e98893
cart controller stock-quantity limit
claymor333 May 7, 2025
0d3ec9f
href addresses
claymor333 May 7, 2025
7fb72a9
stock-quantity limit
claymor333 May 7, 2025
e3b722f
regex untuk symbol 1 huruf besaq punya validation
naaasruul May 7, 2025
47a4654
tukaq shipping total hanya untuk 1 ordaq sahaja
naaasruul May 7, 2025
13255a7
imporve UI
naaasruul May 7, 2025
7110fb9
updted
naaasruul May 7, 2025
5768596
add seller information to cart items and include shipping options
naaasruul May 7, 2025
335929e
add BankAccount management functionality with create and store methods
naaasruul May 7, 2025
2bfb5c5
add bankAccount relationship to User model
naaasruul May 7, 2025
67c09fe
add migration for bank_accounts table with foreign key to sellers
naaasruul May 7, 2025
a0954f9
fix: update order items display to handle JSON format and improve emp…
naaasruul May 7, 2025
c993d71
fix: update image source paths in cart views and display seller bank …
naaasruul May 7, 2025
36eb121
add: include bank account navigation for sellers and define bank acco…
naaasruul May 7, 2025
421fb98
updated
naaasruul May 14, 2025
275d696
updated
naaasruul May 14, 2025
448c9de
updated
naaasruul May 14, 2025
db8a8f3
seller takle upload review done
naaasruul May 21, 2025
61d94e9
updated
naaasruul May 21, 2025
8e00b23
client taknak tunjuk review untk seller sebba dah ada page seller.
naaasruul May 24, 2025
64b0872
show bank accoumnt
naaasruul May 24, 2025
debd7e7
fix: seeder pathing for images
claymor333 May 28, 2025
fecb6ba
fix: header buttons failing to react upon logging in
claymor333 May 28, 2025
3f5bf2b
feat: add numbering
claymor333 May 28, 2025
a8056bb
feat: date
claymor333 May 28, 2025
b18e8cb
feat: make searchable, add numbering, add date formatiing
claymor333 May 28, 2025
e2e6fc1
belh
claymor333 May 28, 2025
ee71d3e
feat: new seeders
claymor333 May 28, 2025
42393a4
feat: add login check
claymor333 May 28, 2025
1c5a291
formatting, GRAMMAR: changed ood (out of delivery) to ofd (out for de…
claymor333 May 28, 2025
ff9c8ff
feat: Add order status update functionality
claymor333 May 28, 2025
c7504f4
feat: add order status
claymor333 May 28, 2025
a1c75a1
fix: product seeder, only seller has product
claymor333 May 28, 2025
02950cf
feat: multiple shipping addresses
claymor333 May 28, 2025
36121cd
feat: update order status
claymor333 May 28, 2025
4ae749b
feat: new icons
claymor333 May 28, 2025
b697ff8
feat: add update order status js
claymor333 May 28, 2025
c7bacd4
feat: admin order data table with filtering, search and per page sele…
claymor333 May 28, 2025
e4ad6eb
feat: add order status col and badge cllasses, use datatable js
claymor333 May 28, 2025
c8ef266
feat: login redirect if attempting to add an item to cart if not authed
claymor333 May 28, 2025
b14fedf
feat: add order status, select pending if the user has not committed …
claymor333 May 28, 2025
80463bc
Add API routes for user authentication and product retrieval
naaasruul Jun 21, 2025
a6aec09
feat: update getAllProducts method to return only in-stock products
naaasruul Jun 22, 2025
0a5ed7a
fixeds
naaasruul Jun 22, 2025
3c21b7b
Merge pull request #1 from naaasruul/fb-fix-carousel
naaasruul Jun 22, 2025
31ac71e
fix: correct asset path for image thumbnails in product viewasd
naaasruul Jun 22, 2025
218d5c2
Merge pull request #2 from naaasruul/fb-fix-carousel
naaasruul Jun 22, 2025
43390f5
fix: update dashboard link and improve section padding for responsive…
naaasruul Jun 26, 2025
17659d2
fix: remove unused fried-egg.png image file
naaasruul Jun 26, 2025
81d9d54
feat: add dashboard banner and categories section to buyer dashboard
naaasruul Jun 26, 2025
e6947a0
fix: reduce app icon size for better display
naaasruul Jun 26, 2025
58e089e
Merge pull request #3 from naaasruul/fb-rumah-sewa
naaasruul Jun 26, 2025
359a569
sdasd
naaasruul Jun 26, 2025
f37e638
Add initial version of app-l0sNRNKZ.js
naaasruul Jun 27, 2025
27aeb9f
Merge pull request #4 from naaasruul/fix-seller
naaasruul Jun 27, 2025
925aa93
Refactor asset loading in Blade templates
naaasruul Jun 27, 2025
8b22b70
Update CSS and JavaScript asset references in Blade templates
naaasruul Jun 27, 2025
d161ded
asdasdasd
naaasruul Jun 27, 2025
de170f4
verify email student
naaasruul Jun 28, 2025
2f3abf2
ok
naaasruul Jun 28, 2025
edfdfae
Add routes for housemate functionality in RentController
naaasruul Jun 30, 2025
c4ac64c
bs-stepper
naaasruul Jun 30, 2025
4d56521
Implement RentController and Rent model with migration for rent listings
naaasruul Jun 30, 2025
66b1b19
Add find housemate form with stepper and AJAX submission
naaasruul Jun 30, 2025
e9600bf
Add stepper components for housemate posting process
naaasruul Jun 30, 2025
5cb9da9
fix route
naaasruul Jun 30, 2025
1f8d04e
Add bs-stepper CSS and JS links to head.blade.php
naaasruul Jun 30, 2025
5dd8464
Refactor form submission logic in find-housemate-form to include tena…
naaasruul Jun 30, 2025
2e6cfd7
Add tenant_total validation and storage in RentController store method
naaasruul Jun 30, 2025
2ce0f17
Add tenant_total field to Rent model and update related views for ten…
naaasruul Jun 30, 2025
80452d6
Add tenant_total column to rents table for tenant management
naaasruul Jun 30, 2025
bdb3b7b
Add tenant total input and update review step in find-housemate-form
naaasruul Jun 30, 2025
5b96078
Refactor RentController to improve method organization and readability
naaasruul Jun 30, 2025
9ed35b1
Implement RentCard component and update rent-related views for improv…
naaasruul Jun 30, 2025
abc51b8
Update stylesheet references in app and head layouts for consistency
naaasruul Jun 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions app/Http/Controllers/Admin/ListOrderController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\Order;
use Illuminate\Http\Request;

class ListOrderController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
//
$orders = Order::all();
return view('admin.orders',compact('orders'));
}

/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}

/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}

/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}

/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}

/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
}
69 changes: 69 additions & 0 deletions app/Http/Controllers/Admin/RatingController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\Review;
use Illuminate\Http\Request;

class RatingController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
//
// Retrieve reviews for products that belong to the seller
$reviews = Review::all();
return view('admin.ratings',compact('reviews'));
}

/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}

/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}

/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}

/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}

/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
}
69 changes: 69 additions & 0 deletions app/Http/Controllers/Admin/TransactionController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\Order;
use Illuminate\Http\Request;

class TransactionController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
//
$orders = Order::all();

return view('admin.transactions', compact('orders'));
}

/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}

/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}

/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}

/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}

/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
}
131 changes: 131 additions & 0 deletions app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<?php

namespace App\Http\Controllers;

use App\Models\Order;
use App\Models\Product;
use App\Models\Review;
use App\Models\User;
use Illuminate\Http\Request;
use Spatie\Permission\Models\Role;

class AdminController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
//
$users = User::all();
$orders = Order::all();
$products = Product::all();
$reviews = Review::all();

$sellers = User::role('seller')->get(); // Fetch all sellers
$buyers = User::role('buyer')->get(); // Fetch all buyers
$admins = User::role('admin')->get(); // Fetch all admins

$buyersCount = $buyers->count();
$sellersCount = $sellers->count();

// Group transactions by day and count them
$transactions = Order::selectRaw('DATE(created_at) as date, COUNT(*) as count')
->groupBy('date')
->orderBy('date', 'ASC')
->get();

// Prepare data for the chart
$transactionDates = $transactions->pluck('date')->map(function ($date) {
return \Carbon\Carbon::parse($date)->format('d F'); // Format date as '01 February'
});
$transactionCounts = $transactions->pluck('count');

// Calculate order statuses
$pendingOrders = Order::where('payment_status', 'pending')->count();
$paidOrders = Order::where('payment_status', 'paid')->count();
$cancelledOrders = Order::where('payment_status', 'cancelled')->count();


return view('admin.dashboard',compact(
'users',
'orders',
'products',
'reviews',
'sellers',
'buyers',
'admins',
'buyersCount',
'sellersCount',
'transactionDates',
'transactionCounts',
'pendingOrders',
'paidOrders',
'cancelledOrders'
));
}

/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}

/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}

/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}

/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}

/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}

public function showManageSeller()
{
// Show the manage seller view
// You can pass any data to the view if needed
$sellers = User::role('seller')->get(); // Fetch all sellers
return view('admin.manage-seller',compact('sellers'));
}

public function showManageBuyer()
{
// Show the manage buyer view
// You can pass any data to the view if needed
$buyers = User::role('buyer')->get(); // Fetch all buyers
return view('admin.manage-buyer',compact('buyers'));
}
}
21 changes: 21 additions & 0 deletions app/Http/Controllers/Api/Seller/ProductController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace App\Http\Controllers\Api\Seller;

use App\Http\Controllers\Controller;
use App\Models\Product;
use Illuminate\Http\Request;

class ProductController extends Controller
{
//

public function getAllProducts(Request $request)
{
// Logic to retrieve all products for the authenticated seller
// This is just a placeholder; you would typically fetch products from the database
$products = Product::where('stock','>',0)->get();

return response()->json($products);
}
}
36 changes: 36 additions & 0 deletions app/Http/Controllers/Auth/NewPassword.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;

class NewPassword extends Controller
{
//
public function resetPassword(Request $request)
{
$request->validate([
'email_or_username' => 'required|string',
'password' => 'required|string|confirmed|min:8',
]);

// Find the user by email or username
$user = User::where('email', $request->email_or_username)
->orWhere('username', $request->email_or_username)
->first();

if (!$user) {
return back()->withErrors(['email_or_username' => __('No user found with this email or username.')]);
}

// Update the user's password
$user->update([
'password' => Hash::make($request->password),
]);

return redirect()->route('login')->with('success', __('Password reset successfully. You can now log in.'));
}
}
Loading