A simple and user-friendly Stock Management Web Application built with Laravel 9. It allows each registered user to manage their own products, track incoming stock (stock-in), outgoing stock (stock-out), and view daily reports — all through a clean web interface.
- 🔐 User Authentication — Register and login with username & password
- 📦 Product Management — Create, edit, and delete your own products
- 📥 Stock In — Record incoming stock with quantity and unit price
- 📤 Stock Out — Record outgoing stock; automatically deducts from available quantity
- 📊 Daily Reports — Filter and view stock-in and stock-out activity by date
- 🧑💼 Per-User Data — Each user sees and manages only their own data
| Layer | Technology |
|---|---|
| Language | PHP 8.0 |
| Framework | Laravel 9.x |
| Database | MySQL (via XAMPP) |
| Auth | Laravel built-in Auth |
| Frontend | Blade Templates |
| Server | Apache (XAMPP) |
stock/
├── app/
│ ├── Http/Controllers/
│ │ ├── AuthController.php # Login, Register, Logout
│ │ ├── DashboardController.php # Dashboard summary counts
│ │ ├── ProductController.php # CRUD for products
│ │ ├── StockController.php # CRUD for stock-in
│ │ ├── StockOutController.php # CRUD for stock-out
│ │ └── ReportController.php # Daily report view
│ └── Models/
│ ├── User.php
│ ├── Product.php
│ ├── Stock.php
│ └── StockOut.php
├── database/
│ └── migrations/ # All table definitions
├── resources/views/ # Blade template files
├── routes/
│ └── web.php # All application routes
└── .env # Environment configuration
| Table | Description |
|---|---|
users |
Registered user accounts |
products |
Products created by each user |
stocks |
Stock-in records (quantity + unit price) |
stock_outs |
Stock-out records (deducts from stock) |
migrations |
Laravel internal migration tracker |
failed_jobs |
Laravel queue system (internal) |
personal_access_tokens |
Sanctum API tokens (internal) |
password_resets |
Password reset tokens (internal) |
| Method | URL | Controller Action | Auth Required |
|---|---|---|---|
| GET | / |
Welcome page | ❌ |
| GET | /register |
Show register form | ❌ |
| POST | /register |
Submit registration | ❌ |
| GET | /login |
Show login form | ❌ |
| POST | /login |
Submit login | ❌ |
| POST | /logout |
Logout user | ✅ |
| GET | /dashboard |
Dashboard with counts | ✅ |
| GET | /products |
List all products | ✅ |
| GET | /products/create |
Show product creation form | ✅ |
| POST | /products |
Store new product | ✅ |
| GET | /products/{id}/edit |
Edit a product | ✅ |
| PUT | /products/{id} |
Update product | ✅ |
| DELETE | /products/{id} |
Delete product | ✅ |
| GET | /stockin |
List all stock-in entries | ✅ |
| GET | /stockin/create |
Show stock-in form | ✅ |
| POST | /stockin |
Record new stock-in | ✅ |
| GET | /stockin/{id}/edit |
Edit stock-in entry | ✅ |
| PUT | /stockin/{id} |
Update stock-in | ✅ |
| DELETE | /stockin/{id} |
Delete stock-in | ✅ |
| GET | /stockout |
List all stock-out entries | ✅ |
| GET | /stockout/create |
Show stock-out form | ✅ |
| POST | /stockout |
Record new stock-out | ✅ |
| DELETE | /stockout/{id} |
Delete stock-out (restores qty) | ✅ |
| GET | /daily-report |
View daily stock report | ✅ |
1. Clone or download the project
cd C:\Users\user\Downloads\stock2. Install PHP dependencies
composer install3. Create your environment file
copy .env.example .env4. Configure the database in .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=stock_db # ← your database name
DB_USERNAME=root
DB_PASSWORD= # ← leave blank if no password5. Generate application key
php artisan key:generate6. Run database migrations (creates all tables)
php artisan migrate7. Start the development server
php artisan serve8. Open in browser
http://127.0.0.1:8000
- Register a new account at
/register - Login with your credentials at
/login - Add Products — Go to Products → Create and add your product names
- Record Stock In — Go to Stock In → Add to record received quantities
- Record Stock Out — Go to Stock Out → Add to record dispatched quantities
- View Reports — Go to Daily Report and pick a date to see activity
- All product, stock-in, and stock-out data is user-scoped (users cannot see each other's data)
- Passwords are hashed using Laravel's
Hash::make()(bcrypt) - All protected routes are guarded by the
authmiddleware - CSRF protection is applied on all forms via Laravel's
@csrftoken
This project is for educational/personal use.
Built with ❤️ using Laravel 9 and XAMPP.